Search code examples
pythonpython-2.7wxpythonpipvirtualenv

wxPython and virtualenv on OS X


Right now Im using OS X Yosemite and trying to install in my virtuaenv few packages via pip:

relrin at MacBook-Relrin in ~ 
=> cd code/Helenae/

relrin at MacBook-Relrin in ~/code/Helenae 
=> source bin/activate

relrin at MacBook-Relrin in ~/code/Helenae workon code 
=> pip install wxPython wxPython-common
Downloading/unpacking wxPython
  Could not find any downloads that satisfy the requirement wxPython
  Some externally hosted files were ignored (use --allow-external wxPython to allow).
Cleaning up...
No distributions at all found for wxPython
Storing debug log for failure in /Users/savicvalera/.pip/pip.log

relrin at MacBook-Relrin in ~/code/Helenae exited 1 workon code 
=> pip install --allow-external wxPython wxPython-common
Downloading/unpacking wxPython-common
  Could not find any downloads that satisfy the requirement wxPython-common
  Some externally hosted files were ignored (use --allow-external wxPython-common to allow).
Cleaning up...
No distributions at all found for wxPython-common
Storing debug log for failure in /Users/savicvalera/.pip/pip.log

Few minutes ago trying install via brew:

brew install wxPython

But installed not in virtualenv, installed in the main user directory. How can I fix this? Cause wxPyWiki doesn't working right now, and i can't look at docs, how to use virtualenv and wxPython.


Solution

  • Just use this:

    1) Install via brew:

       brew install python --framework
       brew install wxPython
    

    2) Make virtualenv when you want

    3) Go to your site-packages directory in your virtualenv and add symbol links:

    cd <there your path to lib/python2.7/site-packages/ in virtualenv>
    ln -s /usr/local/lib/python2.7/site-packages/wx* .