Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am a complete Python/Virtualenv novice. However, I had the exact same problem and found a solution that worked for me. I believe that this will vary greatly depending upon the way you originally setup Python &amp; Virtualenv.</p> <p>In my case, the Lion upgrade completely wiped out all contents of my <code>/Library/Python/2.*/site-packages</code>, but left the now broken executables (which link to the contents of this folder) in <code>/usr/local/bin</code>. I believe that this is the root cause of the cryptic "No module" import errors.</p> <p>Reviewing my .bash_history, I had originally used <code>easy_install</code> to install <code>pip</code>, and then <code>pip</code> to install <code>virtualenv</code> and <code>virtualenvwrapper</code>. Once I repeated these steps, then I was able to re-enter my old virtual environments which still contained all the packages I had installed on 10.6. Note, however, that 10.6 shipped with Python 2.6 as default. If your packages require Python 2.6, you should change your default Python version to 2.6 first.</p> <p>Step-by-step:</p> <ol> <li>I removed old Virtualenv configuration commands from my shell startup scripts (eg., <code>.bash_profile</code>). Start a new terminal session.</li> <li>(optional) Choose the version of Python you wish to use, eg.,<br> <code>defaults write com.apple.versioner.python Version 2.6</code></li> <li><code>sudo easy_install pip</code>. It seems as though <code>/Library/Python/2.*/site-packages</code> now requires administrator privileges. I don't recall that being the case in 10.6 (or at least my bash history doesn't reflect that).</li> <li><code>sudo pip install virtualenv</code></li> <li><code>sudo pip install virtualenvwrapper</code></li> <li>Finally, I re-enabled those virtualenv configuration commands I disabled in step 1. A new terminal session had everything back the way it was (look at <code>pip freeze -l</code> to see local packages in this virtual environment). I think.</li> </ol>
 

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