Issues

Issue #158 resolved

Installing virtualenvwrapper on on OSX 10.8 seems to break Python/pip?

Victor Hooi
created an issue

Hi,

I have OSX 10.8 installed, along with the XCode Command-Line Tools.

Python is the normal system Python:

{{{

!bash

Victors-MacBook-Pro:Downloads victorhooi$ which python /usr/bin/python Victors-MacBook-Pro:Downloads victorhooi$ python --version Python 2.7.2 }}}

I installed virtualenv via pip, which seems to work fine - I'm able to create and use virtualenvs there.

However, when I try to install virtualenvwrapper, I get (this is the second time I ran it - so it's already installed virtualenvwrapper, but that seems to pull in other deps that break:

{{{

!bash

Victors-MacBook-Pro:Downloads victorhooi$ sudo pip install virtualenvwrapper Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in /Library/Python/2.7/site-packages Requirement already satisfied (use --upgrade to upgrade): virtualenv in /Library/Python/2.7/site-packages (from virtualenvwrapper) Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /Library/Python/2.7/site-packages (from virtualenvwrapper) Requirement already satisfied (use --upgrade to upgrade): stevedore in /Library/Python/2.7/site-packages (from virtualenvwrapper) Downloading/unpacking distribute (from stevedore->virtualenvwrapper) Downloading distribute-0.6.28.tar.gz (627kB): 627kB downloaded Running setup.py egg_info for package distribute

Installing collected packages: distribute Running setup.py install for distribute Before install bootstrap. Scanning installed packages Setuptools installation detected at /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg Egg installation Patching... Renaming /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg into /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg.OLD.1346888427.26 Patched done. Relaunching... Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'install' is not defined Complete output from command /usr/bin/python -c "import setuptools;file='/tmp/pip-build/distribute/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-VctUMg-record/install-record.txt --single-version-externally-managed: Before install bootstrap.

Scanning installed packages

Setuptools installation detected at /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg

Egg installation

Patching...

Renaming /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg into /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg.OLD.1346888427.26

Patched done.

Relaunching...

Traceback (most recent call last):

File "<string>", line 1, in <module>

NameError: name 'install' is not defined


Command /usr/bin/python -c "import setuptools;file='/tmp/pip-build/distribute/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-VctUMg-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/distribute Storing complete log in /Users/victorhooi/Library/Logs/pip.log Victors-MacBook-Pro:Downloads victorhooi$ sudo python ez_setup.py Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg Processing setuptools-0.6c11-py2.7.egg removing '/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg' (and everything under it) Copying setuptools-0.6c11-py2.7.egg to /Library/Python/2.7/site-packages setuptools 0.6c11 is already the active version in easy-install.pth Installing easy_install script to /usr/local/bin Installing easy_install-2.7 script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg Processing dependencies for setuptools==0.6c11 Finished processing dependencies for setuptools==0.6c11 }}}

Then, after that, if I try to use pip:

{{{

!bash

Victors-MacBook-Pro:Downloads victorhooi$ pip install yolk Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-1.2-py2.7.egg/pip/basecommand.py", line 106, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip-1.2-py2.7.egg/pip/commands/install.py", line 248, in run import setuptools ImportError: No module named setuptools

Storing complete log in /Users/victorhooi/Library/Logs/pip.log }}}

I have to run the ez_setup.py script again after that to repair my environment.

Cheers, Victor

Comments (11)

  1. agos

    Same here. Can be repaired by reinstalling setuptools. Pip install distribute by itself doesn't break anything but doesn't work:

    Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/distribute/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-T3MIvq-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/distribute
    

    Traceback from the log:

    Exception information:
    Traceback (most recent call last):
      File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main
        status = self.run(options, args)
      File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 261, in run
        requirement_set.install(install_options, global_options)
      File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 1166, in install
        requirement.install(install_options, global_options)
      File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 589, in install
        cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
      File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/util.py", line 612, in call_subprocess
        % (command_desc, proc.returncode, cwd))
    
  2. agos

    Ok, a bit more digging revealed that SUDO installing distribute will indeed break setuptools.

    sudo pip install distribute
    Downloading/unpacking distribute
      Running setup.py egg_info for package distribute
        
    Installing collected packages: distribute
      Running setup.py install for distribute
        Before install bootstrap.
        Scanning installed packages
        Setuptools installation detected at /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg
        Egg installation
        Patching...
        Renaming /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg into /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg.OLD.1347114788.35
        Patched done.
        Relaunching...
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
        NameError: name 'install' is not defined
        Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/distribute/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-HiGuy4-record/install-record.txt --single-version-externally-managed:
        Before install bootstrap.
    
    Scanning installed packages
    
    Setuptools installation detected at /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg
    
    Egg installation
    
    Patching...
    
    Renaming /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg into /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg.OLD.1347114788.35
    
    Patched done.
    
    Relaunching...
    
    Traceback (most recent call last):
    
      File "<string>", line 1, in <module>
    
    NameError: name 'install' is not defined
    
    ----------------------------------------
    Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/distribute/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-HiGuy4-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/distribute
    
  3. Rick van Hattem

    Still... it's quite a PITA that if you run this command on a completely new environment, you break pip and easy_install:

    pip install virtualenvwrapper
    

    Is removing the distribute requirement (at least temporarily) an option maybe?

    Note that after this, you cannot run "pip install distribute" anymore since pip is completely broken. The only way to fix it is to manually go to the distribute site, download the setup file and install it manually.

    It is not OS X exclusive btw, I've had it on Ubuntu when running these commands:

    mkproject test
    pip install virtualenvwrapper
    
  4. Jon Crowell

    I'm having the same problem. I successfully uninstalled setup_tools, but then when I run "pip install distribute" I get the following message:

    Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 248, in run import setuptools ImportError: No module named setuptools

    Doug wrote "Distribute replaces setuptools" but it appears that I cannot install distribute unless I have a module named setuptools.

  5. Doug Hellmann repo owner

    Distribute is a forked and updated version of setuptools. Instructions for installing it, including dealing with the conflicts reported here, are described on http://pypi.python.org/pypi/distribute

    After distribute is installed, set the environment variable VIRTUALENV_USE_DISTRIBUTE=1 in your login script and all new virtualenvs will use distribute instead of setuptools.

  6. Log in to comment