I'm having trouble with using 'requests' module on my Mac. I use python34 and I installed 'requests' module via pip. I can verify this via running installation again and it'll show me that module is already installed.
15:49:29|mymac [~]:pip install requests
Requirement already satisfied (use --upgrade to upgrade): requests in /opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages
Although I can import 'requests' module via interactive Python interpreter, trying to execute 'import requests' in PyCharm yields error 'No module named requests'. I checked my PyCharm Python interpreter settings and (I believe) it's set to same python34 as used in my environment. However, I can't see 'requests' module listed in PyCharm either.
It's obvious that I'm missing something here. Can you guys advise where should I look or what should I fix in order to get this module working? I was living under impression that when I install module via pip in my environment, PyCharm will detect these changes. However, it seems something is broken on my side ...
which -a python
output?/usr/local/bin/python3
. set your interpreter to/usr/local/bin/python3
. If you usually usePython 3.4.3
I would remove the other, having a few different versions of the same python can be a pain as you have found out. It is safe to remove, you only need to be careful when dealing with your system python./usr/bin/python
, your OS would use your system python so removing or changing it would almost certainly break it, you can remove python3 safely and/opt/local/bin/python
also . As john suggested you can use a virtualenv for different projects which is an isolated environment virtualenv.pypa.io/en/latest. I also like pyenv github.com/yyuu/pyenv. So keep your/usr/bin/python
always and you can remove or keep any of the rest.