python - Install local dist package into virtualenv -


i have pytest test, let's call test.py. used run test outside of virtualenv; i'm trying run inside virtualenv sandbox.

the project structured this:

~/project/test # test.py , virtualenv files live ~/project/mylibrary 

test.py imports mylibrary. in past, worked because have code in ~/project/mylibrary installed /usr/lib/python2.7/dist-packages/mylibrary.

i can't run virtualenv --system-site-packages flag. can't move code ~/project/mylibrary ~/project/test folder. how can access code in mylibrary inside virtualenv?

you don't need special - long working inside virtualenv, python setup.py install automatically install packages into

$virtual_env/lib/python2.7/site-packages 

rather system-wide

/usr/lib/python2.7/dist-packages 

directory.

in general it's better use pip install mylibrary/, since way can neatly uninstall package using pip uninstall mylibrary.

if you're installing working copy of code you're developing, might idea install in "editable" mode using pip install -e mylibrary/, creates link source directory installed module gets updated edit code.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -