Issue #173 new

IOError: [Errno 13] Permission denied: '/usr/lib/python2.5/site-packages/setuptools-0.6c11-py2.5.egg-info'

ghazel
created an issue

Trying to install distribute, it failed globally and failed as a local user install.

Some info about my user account:

{{{ gah@duma:~$ echo $PYTHONPATH /home/gah/lib/python/:/home/gah/lib/python2.5/site-packages gah@duma:~$ cat .pydistutils.cfg && echo [easy_install]

set the default location to install packages

install_dir = /home/gah/lib/python gah@duma:~$ curl -O http://python-distribute.org/distribute_setup.py % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 15757 100 15757 0 0 25203 0 --:--:-- --:--:-- --:--:-- 42660 }}}

First I tried to install distribute globally:

{{{ gah@duma:~$ sudo python distribute_setup.py Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.13.tar.gz Extracting in /tmp/tmpQcyAk0 Now working in /tmp/tmpQcyAk0/distribute-0.6.13 Installing Distribute Before install bootstrap. Scanning installed packages Setuptools installation detected at /usr/lib/python2.5/site-packages Non-egg installation Removing elements out of the way... Renaming /usr/lib/python2.5/site-packages/setuptools.egg-info into /usr/lib/python2.5/site-packages/setuptools.egg-info.OLD.1276821188.76 Renaming /usr/lib/python2.5/site-packages/setuptools into /usr/lib/python2.5/site-packages/setuptools.OLD.1276821188.78 Renaming /usr/lib/python2.5/site-packages/pkg_resources.py into /usr/lib/python2.5/site-packages/pkg_resources.py.OLD.1276821188.78 Renaming /usr/lib/python2.5/site-packages/site.py into /usr/lib/python2.5/site-packages/site.py.OLD.1276821188.78 Patched done. Relaunching... Before install bootstrap. Scanning installed packages Setuptools installation detected at /usr/lib/python2.5/site-packages Non-egg installation Removing elements out of the way... /usr/lib/python2.5/site-packages/setuptools.egg-info/EGG-INFO/PKG-INFO already patched. /usr/lib/python2.5/site-packages/setuptools.egg-info already patched. running install install_dir /home/gah/lib/python Checking .pth file support in /home/gah/lib/python /usr/bin/python -E -c pass TEST FAILED: /home/gah/lib/python does NOT support .pth files error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/home/gah/lib/python

and your PYTHONPATH environment variable currently contains:

''

Here are some of your options for correcting the problem:

  • You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files

  • You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.)

  • You can set up the installation directory to support ".pth" files by using one of the approaches described here:

http://packages.python.org/distribute/easy_install.html#custom-installation-locations

Please make the appropriate changes for your system and try again. Something went wrong during the installation. See the error message above. }}}

Then I tried to install distribute the the local user prefix:

{{{ gah@duma:~$ python distribute_setup.py Extracting in /tmp/tmptGz7j2 Now working in /tmp/tmptGz7j2/distribute-0.6.13 Installing Distribute Before install bootstrap. Scanning installed packages Setuptools installation detected at /usr/lib/python2.5/site-packages Non-egg installation Removing elements out of the way... /usr/lib/python2.5/site-packages/setuptools.egg-info/EGG-INFO/PKG-INFO already patched. /usr/lib/python2.5/site-packages/setuptools.egg-info already patched. running install install_dir /home/gah/lib/python /tmp/tmptGz7j2/distribute-0.6.13/setuptools/package_index.py:158: UserWarning: Unbuilt egg for setuptools [unknown version] (/usr/lib/python2.5/site-packages) Environment.init(self,args,*kw) /tmp/tmptGz7j2/distribute-0.6.13/setuptools/command/easy_install.py:282: UserWarning: Unbuilt egg for setuptools [unknown version] (/usr/lib/python2.5/site-packages) self.local_index = Environment(self.shadow_path+sys.path) running bdist_egg running egg_info writing distribute.egg-info/PKG-INFO writing top-level names to distribute.egg-info/top_level.txt writing dependency_links to distribute.egg-info/dependency_links.txt writing entry points to distribute.egg-info/entry_points.txt reading manifest file 'distribute.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'distribute.egg-info/SOURCES.txt' installing library code to build/bdist.linux-i686/egg running install_lib running build_py creating build creating build/lib copying pkg_resources.py -> build/lib copying easy_install.py -> build/lib copying site.py -> build/lib creating build/lib/setuptools copying setuptools/init.py -> build/lib/setuptools copying setuptools/archive_util.py -> build/lib/setuptools copying setuptools/depends.py -> build/lib/setuptools copying setuptools/dist.py -> build/lib/setuptools copying setuptools/extension.py -> build/lib/setuptools copying setuptools/package_index.py -> build/lib/setuptools copying setuptools/sandbox.py -> build/lib/setuptools creating build/lib/setuptools/command copying setuptools/command/init.py -> build/lib/setuptools/command copying setuptools/command/alias.py -> build/lib/setuptools/command copying setuptools/command/bdist_egg.py -> build/lib/setuptools/command copying setuptools/command/bdist_rpm.py -> build/lib/setuptools/command copying setuptools/command/bdist_wininst.py -> build/lib/setuptools/command copying setuptools/command/build_ext.py -> build/lib/setuptools/command copying setuptools/command/build_py.py -> build/lib/setuptools/command copying setuptools/command/develop.py -> build/lib/setuptools/command copying setuptools/command/easy_install.py -> build/lib/setuptools/command copying setuptools/command/easy_install2.py -> build/lib/setuptools/command copying setuptools/command/egg_info.py -> build/lib/setuptools/command copying setuptools/command/install.py -> build/lib/setuptools/command copying setuptools/command/install_egg_info.py -> build/lib/setuptools/command copying setuptools/command/install_lib.py -> build/lib/setuptools/command copying setuptools/command/install_scripts.py -> build/lib/setuptools/command copying setuptools/command/register.py -> build/lib/setuptools/command copying setuptools/command/rotate.py -> build/lib/setuptools/command copying setuptools/command/saveopts.py -> build/lib/setuptools/command copying setuptools/command/sdist.py -> build/lib/setuptools/command copying setuptools/command/setopt.py -> build/lib/setuptools/command copying setuptools/command/test.py -> build/lib/setuptools/command copying setuptools/command/upload.py -> build/lib/setuptools/command copying setuptools/command/upload_docs.py -> build/lib/setuptools/command creating build/lib/setuptools/tests copying setuptools/tests/init.py -> build/lib/setuptools/tests copying setuptools/tests/doctest.py -> build/lib/setuptools/tests copying setuptools/tests/server.py -> build/lib/setuptools/tests copying setuptools/tests/test_build_ext.py -> build/lib/setuptools/tests copying setuptools/tests/test_develop.py -> build/lib/setuptools/tests copying setuptools/tests/test_easy_install.py -> build/lib/setuptools/tests copying setuptools/tests/test_packageindex.py -> build/lib/setuptools/tests copying setuptools/tests/test_resources.py -> build/lib/setuptools/tests copying setuptools/tests/test_sandbox.py -> build/lib/setuptools/tests copying setuptools/tests/test_upload_docs.py -> build/lib/setuptools/tests copying setuptools/cli.exe -> build/lib/setuptools copying setuptools/gui.exe -> build/lib/setuptools creating build/bdist.linux-i686 creating build/bdist.linux-i686/egg copying build/lib/pkg_resources.py -> build/bdist.linux-i686/egg copying build/lib/easy_install.py -> build/bdist.linux-i686/egg copying build/lib/site.py -> build/bdist.linux-i686/egg creating build/bdist.linux-i686/egg/setuptools copying build/lib/setuptools/init.py -> build/bdist.linux-i686/egg/setuptools copying build/lib/setuptools/archive_util.py -> build/bdist.linux-i686/egg/setuptools copying build/lib/setuptools/depends.py -> build/bdist.linux-i686/egg/setuptools copying build/lib/setuptools/dist.py -> build/bdist.linux-i686/egg/setuptools copying build/lib/setuptools/extension.py -> build/bdist.linux-i686/egg/setuptools copying build/lib/setuptools/package_index.py -> build/bdist.linux-i686/egg/setuptools copying build/lib/setuptools/sandbox.py -> build/bdist.linux-i686/egg/setuptools creating build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/init.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/alias.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/bdist_egg.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/bdist_rpm.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/bdist_wininst.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/build_ext.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/build_py.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/develop.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/easy_install.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/easy_install2.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/egg_info.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/install.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/install_egg_info.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/install_lib.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/install_scripts.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/register.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/rotate.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/saveopts.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/sdist.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/setopt.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/test.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/upload.py -> build/bdist.linux-i686/egg/setuptools/command copying build/lib/setuptools/command/upload_docs.py -> build/bdist.linux-i686/egg/setuptools/command creating build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/tests/init.py -> build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/tests/doctest.py -> build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/tests/server.py -> build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/tests/test_build_ext.py -> build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/tests/test_develop.py -> build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/tests/test_easy_install.py -> build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/tests/test_packageindex.py -> build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/tests/test_resources.py -> build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/tests/test_sandbox.py -> build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/tests/test_upload_docs.py -> build/bdist.linux-i686/egg/setuptools/tests copying build/lib/setuptools/cli.exe -> build/bdist.linux-i686/egg/setuptools copying build/lib/setuptools/gui.exe -> build/bdist.linux-i686/egg/setuptools byte-compiling build/bdist.linux-i686/egg/pkg_resources.py to pkg_resources.pyc byte-compiling build/bdist.linux-i686/egg/easy_install.py to easy_install.pyc byte-compiling build/bdist.linux-i686/egg/site.py to site.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/init.py to init.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/archive_util.py to archive_util.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/depends.py to depends.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/dist.py to dist.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/extension.py to extension.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/package_index.py to package_index.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/sandbox.py to sandbox.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/init.py to init.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/alias.py to alias.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/bdist_egg.py to bdist_egg.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/bdist_rpm.py to bdist_rpm.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/bdist_wininst.py to bdist_wininst.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/build_ext.py to build_ext.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/build_py.py to build_py.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/develop.py to develop.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/easy_install.py to easy_install.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/easy_install2.py to easy_install2.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/egg_info.py to egg_info.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/install.py to install.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/install_egg_info.py to install_egg_info.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/install_lib.py to install_lib.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/install_scripts.py to install_scripts.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/register.py to register.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/rotate.py to rotate.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/saveopts.py to saveopts.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/sdist.py to sdist.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/setopt.py to setopt.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/test.py to test.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/upload.py to upload.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/command/upload_docs.py to upload_docs.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/tests/init.py to init.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/tests/doctest.py to doctest.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/tests/server.py to server.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/tests/test_build_ext.py to test_build_ext.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/tests/test_develop.py to test_develop.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/tests/test_easy_install.py to test_easy_install.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/tests/test_packageindex.py to test_packageindex.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/tests/test_resources.py to test_resources.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/tests/test_sandbox.py to test_sandbox.pyc byte-compiling build/bdist.linux-i686/egg/setuptools/tests/test_upload_docs.py to test_upload_docs.pyc creating build/bdist.linux-i686/egg/EGG-INFO copying distribute.egg-info/PKG-INFO -> build/bdist.linux-i686/egg/EGG-INFO copying distribute.egg-info/SOURCES.txt -> build/bdist.linux-i686/egg/EGG-INFO copying distribute.egg-info/dependency_links.txt -> build/bdist.linux-i686/egg/EGG-INFO copying distribute.egg-info/entry_points.txt -> build/bdist.linux-i686/egg/EGG-INFO copying distribute.egg-info/entry_points.txt.orig -> build/bdist.linux-i686/egg/EGG-INFO copying distribute.egg-info/top_level.txt -> build/bdist.linux-i686/egg/EGG-INFO copying distribute.egg-info/zip-safe -> build/bdist.linux-i686/egg/EGG-INFO creating dist creating 'dist/distribute-0.6.13-py2.5.egg' and adding 'build/bdist.linux-i686/egg' to it removing 'build/bdist.linux-i686/egg' (and everything under it) Processing distribute-0.6.13-py2.5.egg creating /home/gah/lib/python/distribute-0.6.13-py2.5.egg Extracting distribute-0.6.13-py2.5.egg to /home/gah/lib/python Adding distribute 0.6.13 to easy-install.pth file Installing easy_install script to /home/gah/lib/python Installing easy_install-2.5 script to /home/gah/lib/python

Installed /home/gah/lib/python/distribute-0.6.13-py2.5.egg Processing dependencies for distribute==0.6.13 Finished processing dependencies for distribute==0.6.13 After install bootstrap. Creating /usr/lib/python2.5/site-packages/setuptools-0.6c11-py2.5.egg-info Traceback (most recent call last): File "setup.py", line 216, in <module> _after_install(dist) File "/tmp/tmptGz7j2/distribute-0.6.13/distribute_setup.py", line 295, in _after_install _create_fake_setuptools_pkg_info(placeholder) File "/tmp/tmptGz7j2/distribute-0.6.13/distribute_setup.py", line 222, in __no_sandbox return function(args, *kw) File "/tmp/tmptGz7j2/distribute-0.6.13/distribute_setup.py", line 310, in _create_fake_setuptools_pkg_info f = open(pkg_info, 'w') IOError: [Errno 13] Permission denied: '/usr/lib/python2.5/site-packages/setuptools-0.6c11-py2.5.egg-info' Something went wrong during the installation. See the error message above. }}}

Comments (4)

  1. Tarek Ziadé repo owner

    For your first install setup, your target location looks not like an appopriate one (did you manage to install other packages there already ?)

    For the second one, you forgot to call "sudo"

  2. ghazel reporter

    For my first install setup, I was trying to install globally at "/usr/lib/python2.5/site-packages/". This is usually how I install packages globally, and it usually works. What do you mean the target location it is not an "appropriate" one?

    For the second one, I did not forget to call "sudo". I specifically did not call "sudo", because you do not need it to install locally. See how it determined "install_dir /home/gah/lib/python" by itself, but then somewhere in the process mistakenly decided to write to "/usr/lib/python2.5/site-packages"?

    I was able to get "easy_install distribute" to work, which correctly installed in "/home/gah/lib/python", however "sudo easy_install distribute" does not work, because it gets "ImportError: No module named setuptools.command.easy_install".

  3. Anonymous
  4. Log in to comment