0
votes

I have python 2.7.5 and i installed some packages as

python setup.py install --user

so this installed packages in

/users/me/.local/lib/python2.7/site-packages

and then i updated the PYTHONPATH variable to be

/users/me/.local/lib/python2.7/site-packages,/users/me/.local/lib/python2.7/site-packages

but now if i try to do

virtualenv

which is the package i installed, i get

bash: virtualenv: command not found

how can i use the virtualenv package that has been installed outside of site-packages?

EDIT

here is my sys.path

'', '/users/me/.local/lib/python2.7/site-packages/virtualenv-15.1.0.dev0-py2.7.egg', '/usr/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg', '/usr/lib/python2.7/site-packages/supervisor-3.2.0-py2.7.egg', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/users/me/.local/lib/python2.7/site-packages', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages', '/users/me/.local/lib/python2.7/site-packages'

but i still get the command not found error

also, here is my $PATH

/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/users/me/.local/lib/python2.7/site-packages:/users/me/.local/lib/python2.7/site-packages

1
did you restart your terminal? you might need to edit PATH, not PYTHONPATH - Paul H
i tried the solution on that question but i still get the command not found. even after restarting and adding export PATH=$PATH:/users/me/.local/lib/python2.7/site-packages:/users/me/.local/lib/python2.7/site-packages to my .profile - AbtPst

1 Answers

0
votes

You can append the value of the path to your new library in the PYTHONPATH environment variable.

How to add to the pythonpath in windows 7?

But you can also append a path in runtime.

import sys
sys.path.append('/dir1/dir2/libs')