0

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

AbtPst
  • 7,778
  • 17
  • 91
  • 172
  • did you restart your terminal? you might need to edit PATH, not PYTHONPATH – Paul H Apr 26 '16 at 19:30
  • Possible duplicate of [virtualenv: command not found after installed with Pip on Mac](http://stackoverflow.com/questions/15568718/virtualenv-command-not-found-after-installed-with-pip-on-mac) – Pierre Barre Apr 26 '16 at 19:30
  • 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 Apr 26 '16 at 19:52

1 Answers1

0

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')
Community
  • 1
  • 1
Geoffrey-ap
  • 380
  • 3
  • 12
  • can you run the following command to see if your site_packages location is the right one. import site; site.getsitepackages() – Geoffrey-ap Apr 26 '16 at 20:38