0
votes

In short: I am using virtualenv to manage a large amount of requirements but I am concerned that I have conflicting versions of major packages on my Mac.

I have installed both scikit-learn and matplotlib via pip, but my PyCharm won’t acknowledge they exist.

Then I allowed PyCharm (and I tried dozens of times) to “Install requirements” but the error kept coming up when installing matplotlib:

  • The following required packages can not be built:

                    * freetype
    

I’ve tried installing freetype in any ways but it seems to already be here. How do I get passed that error?

From other postings, I learned there is a very noble attempt to get these and many other essential Scientific Python packages installed using the Scipy Superpack for Homebrew

https://github.com/fonnesbeck/ScipySuperpack

I believe this installed correctly but Pycharm still doesn't see it.

Could I be pointing to the original (presumably failed) pip installs when I want to point to the Scipy Superpack?? How do I update my virtualenv to see these packages?

I also found the Anaconda version of Python (which should include matplotlib AND scikit-learn?) and my virtualenv was not pointed to that python executable, but updating that did not help. Do I need to update “which” matplotlib or other packages to point to as well?

I have literally been at this for days and I would throughly appreciate some help. So much in the scientific community of Python requires matplotlib and my research looks like it could really benefit from scikit-learn so any help is greatly appreciated. I realize there are dozens of other posts related to this but the solutions have not resolved my issue. Thank you for any help you can give!

Additional requested info:

python -c "import sys; print sys.path" gave:

['', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7/site-packages/statsmodels-0.6.1-py2.7-macosx-10.9-intel.egg', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7/site-packages/patsy-0.3.0-py2.7.egg', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7/site-packages/scipy-0.15.1-py2.7-macosx-10.9-intel.egg', '/[$HOME]/.virtualenvs/JS_dj17/lib/python27.zip', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7/plat-darwin', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7/plat-mac', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7/plat-mac/lib-scriptpackages', '/[$HOME]/.virtualenvs/JS_dj17/Extras/lib/python', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7/lib-tk', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7/lib-old', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/[$HOME]/.virtualenvs/JS_dj17/lib/python2.7/site-packages']

1
What python interpreter and PYTHONPATH is your pycharm looking at? jetbrains.com/pycharm/help/run-debug-configuration-python.htmlJoshua Olson

1 Answers

1
votes

Okay, I think I see the problem. You're using system python (on macs you get these issues a lot if you try and use system python, commonly people will use an alternative python), but homebrew installs to /usr/local, so if you do a

brew install pythonX.X

then when you create your virtualenv environment (https://www.jetbrains.com/pycharm/help/creating-virtual-environment.html) select the python out of /usr/local/bin instead and check the inherit global site-packages. That will probably take care of your issues.