Python install uninstall easy_install

I have two versions of python on my mac:

One preinstalled Apple in /usr/bin

One from python.org at /Library/Frameworks/Python.framework/Versions/2.6

easy_install is always installed on /usr/bin for some reason

So, I'm setting easy_install to right now:

 sh setuptools-0.6c11-py2.6.egg --install-dir=/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages 

Now I want easy_install pip AND ....:

 Searching for pip Best match: pip 0.8 Processing pip-0.8-py2.6.egg pip 0.8 is already the active version in easy-install.pth Installing pip script to /usr/local/bin error: /usr/local/bin/pip: Permission denied 

My path and pythonpath:

 PATH="/Library/Frameworks/Python.framework/Versions/2.6/bin:${PATH}" export PATH PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}" export PATH PYTHONPATH="/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages" export PYTHONPATH 
  • Another PYTHONPATH where I store the modules I wrote

Sorry, I really don't understand.

What am I doing wrong.

I just want to regularly install modules in the Python Framework directory

+7
python easy-install
source share
2 answers

It is not possible to indicate exactly what your installation is based on the information provided. /usr/local/bin is the default installation location for the supplied Apple /usr/bin/easy_install , so most likely you will somehow call it instead of the easy_install that should have been installed by running sh setuptools... script . There is no need to use the --install-dir parameter for setuptools, and also do not install PYTHONPATH to specify the directory of the package sites directory; what happens automatically. And you should not change the PATH variable twice, just use the first PATH and export.

Starting with the recently installed Python 2.6.5 from the python.org installer and a new terminal session, here's the whole sequence:

 $ curl -O http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 325k 100 325k 0 0 125k 0 0:00:02 0:00:02 --:--:-- 136k $ PATH="/Library/Frameworks/Python.framework/Versions/2.6/bin:${PATH}" $ export PATH $ echo $PATH /Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin $ which python2.6 /Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 $ python2.6 -c "import sys;print(sys.version_info)" (2, 6, 5, 'final', 0) $ sh setuptools-0.6c11-py2.6.egg Processing setuptools-0.6c11-py2.6.egg Copying setuptools-0.6c11-py2.6.egg to /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages Adding setuptools 0.6c11 to easy-install.pth file Installing easy_install script to /Library/Frameworks/Python.framework/Versions/2.6/bin Installing easy_install-2.6 script to /Library/Frameworks/Python.framework/Versions/2.6/bin Installed /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg Processing dependencies for setuptools==0.6c11 Finished processing dependencies for setuptools==0.6c11 $ which easy_install /Library/Frameworks/Python.framework/Versions/2.6/bin/easy_install $ easy_install pip Searching for pip Reading http://pypi.python.org/simple/pip/ Reading http://pip.openplans.org Best match: pip 0.8 Downloading http://pypi.python.org/packages/source/p/pip/pip-0.8.tar.gz#md5=468d9adc309f33ad51cee38f0d455429 Processing pip-0.8.tar.gz Running pip-0.8/setup.py -q bdist_egg --dist-dir /var/folders/Ux/UxzFPTCnF3esOnKQ1d3bbE+++TI/-Tmp-/easy_install-JU05mJ/pip-0.8/egg-dist-tmp-zwrzwI warning: no previously-included files matching '*.txt' found under directory 'docs/_build' no previously-included directories found matching 'docs/_build/_sources' Adding pip 0.8 to easy-install.pth file Installing pip script to /Library/Frameworks/Python.framework/Versions/2.6/bin Installing pip-2.6 script to /Library/Frameworks/Python.framework/Versions/2.6/bin Installed /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pip-0.8-py2.6.egg Processing dependencies for pip Finished processing dependencies for pip $ pip --version pip 0.8 from /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pip-0.8-py2.6.egg (python 2.6) 
+8
source share

Removing django package.

You must run this command first

$ easy_install -m [PACKAGE]

This command will remove all package dependencies. then delete the egg file of this package.

$ rm -rf ... / python2.X / site-packages / [PACKAGE] .egg

+1
source share

All Articles