osx - Python tries to install everything into /lib on os x -


i think somehow path /lib stored in python dist should not be.

it started when having troubles installing python modules using pip. pip seemed install /lib/python2.7/site-packages python not find it.

sidenote: pip uninstall not find package in /lib either, pip install install it.

i tried:

which pip $/usr/bin/pip $which python /usr/bin/python 

i decided uninstall pip,

$ easy_install uninstall pip error: can't create or remove files in install directory  following error occurred while trying add or remove files in installation directory:  [errno 13] permission denied: '/lib'  installation directory specified (via --install-dir, --prefix, or distutils default setting) was:  /lib/python2.7/site-packages/ 

it seemed in easy-install, '/lib' location used. googled bit, , decided reinstall easy-install. removed it:

$sudo rm /usr/local/bin/easy_install 

and tried install again:

$ sudo curl https://bootstrap.pypa.io/ez_setup.py -o - | python checking .pth file support in /lib/python2.7/site-packages/ error: can't create or remove files in install directory 

so problem want python installation clean possible, , /lib location stored somewhere.

some side information

  • i getting more familiar file structure of python used know little it. had many problems installing python packages used many different python versions trough tutorials. (via brew, canopy, anaconda, ipython). uninstall of them because want clean installation possible. (i once had tried uninstall site-package , discovered stored in 4 different locations simultaniously!)

  • $ python

    /usr/bin/python

  • most of site-packages right installed in:

    /usr/local/lib/python2.7/site-packages

    /users/myusersname/library/python/2.7/lib/python/site-packages

  • empty:

    $ echo $pythonpath

    • os-x 10.9.5

i hope guys can me!

easy install pip

i want clean possible uninstalled homebrew version of python.

edit:

python homebrew uninstalled python versions except system 1 (/usr/bin/python). tried install python via homebrew (/usr/local/bin/python link cellar).

when try run pip:

$which pip /usr/local/pip  $pip traceback (most recent call last):  file "/usr/local/bin/pip", line 5, in <module>  pkg_resources import load_entry_point file "/system/library/frameworks/python.framework/versions/2.7/extras/lib/python/pkg_resources.py", line 2603, in <module> working_set.require(__requires__)   file "/system/library/frameworks/python.framework/versions/2.7/extras/lib/python/pkg_resources.py", line 666, in require needed = self.resolve(parse_requirements(requirements))  file "/system/library/frameworks/python.framework/versions/2.7/extras/lib/python/pkg_resources.py", line 565, in resolve raise distributionnotfound(req)  # xxx put more info here pkg_resources.distributionnotfound: pip==1.5.6 

when try

sudo easy_install -u pip test failed: /lib/python2.7/site-packages/ not support .pth files error: bad install directory or pythonpath 

python python.org uninstalled homebrew python , installed python using gui installer website. checked /usr/local/bin/python link python.

this python not come pip or easy install. run setuptools:

$ sudo python ez_setup.py  extracting in /tmp/tmpr80ydp working in /tmp/tmpr80ydp/setuptools-7.0 installing setuptools running install checking .pth file support in /lib/python2.7/site-packages/ /library/frameworks/python.framework/versions/2.7/resources/python.app/contents/macos/python -e -c pass test failed: /lib/python2.7/site-packages/ not support .pth files error: bad install directory or pythonpath attempting install package directory not on pythonpath , python not read ".pth" files from.  installation directory specified (via --install-dir, --prefix, or distutils default setting) was: /lib/python2.7/site-packages/ 

this error allways getting. persistent , hope guys can me it. allready tried of solutions here:

but nothing helps.

setting pythonpath or running or witouth sudo doesn't eigther.

export pythonpath='/library/python/2.7/site-packages' 

if want python installation clean possible should consider using virtual environment.

$ sudo pip install virtualenv $ pyvenv env                   # create virtual environment $ source env/bin/activate      # activate virtual environment (env) $ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python   # install pip in virtualenv 

this code works python 3.4 should similar python 2.7. can install packages do:

(env) $ pip install [package name] 

all packages install way saved in "env" directory. if want run program inside virtual environment have activate first. when done, can deactivate it.

(env) $ deactivate 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -