Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I encountered this <code>distutils/__init__.py</code> problem when transitioning to OS X 10.7 Lion (from OS X 10.5 Leopard) and using Migration Assistant. I've already installed Xcode 3.2.6 -- thus resolving the missing install_name_tool problem.</p> <p>Migration Assistant brought over my previous virtualenvs, but since they were based on Leopard's Python 2.5, I figure I need to recreate each of them with the current system Python 2.7.</p> <p>easy_install was already in the PATH -- probably because it was bundled with Lion's Python 2.7; it seems unlikely to be the result of Migration Assistant. I used easy_install to install virtualenv.</p> <p>This problem, it seems to me, doesn't have anything to do with Xcode or lack thereof. It's a peculiar line in a file placed in the new virtual env by the virtualenv command:</p> <pre><code> File "/path/to/my/virtualenv/lib/python2.7/distutils/__init__.py", line 16, in exec(open(os.path.join(distutils_path, '__init__.py')).read()) IOError: [Errno 2] No such file or directory: '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/__init__.py' </code></pre> <p>The issue is that, in the Python 2.7 install bundled with Lion, the library doesn't come with .py source files. That directory contains .pyc and .pyo files, but no .py files. virtualenv doesn't seem to expect that.</p> <p>My workaround is to download Python 2.7 source:<br/> <a href="http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2">http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2</a></p> <p>and unpack <code>distutils/__init__.py</code> into the expected place:<br/> <code> sudo tar xvjf ~/Downloads/Python-2.7.2.tar.bz2 --strip-components=2 -C /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 <code>Python-2.7.2/Lib/distutils/__init__.py</code> </code></p> <p>That permits virtualenv to complete successfully, and the resulting Python interpreter seems to run.</p> <p>Given that the Python 2.7 library bundled with Lion is installed without source, it might seem useful to change virtualenv to try for either <code>distutils/__init__.py</code> or <code>distutils/__init__.pyc</code> ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload