On a Mac, trying to get Python 3.6 setup.
Sams-MacBook-Pro:~ samgreenberg$ which pip3
/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3
Sams-MacBook-Pro:~ samgreenberg$ which python3
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
then
Sams-MacBook-Pro:~ samgreenberg$ pip3 list
DEPRECATION: The default format will switch to columns in the future.
You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
biopython (1.70)
certifi (2017.7.27.1)
chardet (3.0.4)
cycler (0.10.0)
decorator (4.1.2)
idna (2.6)
ipython-genutils (0.2.0)
jsonschema (2.6.0)
jupyter-core (4.3.0)
matplotlib (2.0.2)
nbformat (4.4.0)
numpy (1.13.1)
olefile (0.44)
Pillow (4.3.0)
pip (9.0.1)
plotly (2.0.15)
pyparsing (2.2.0)
python-dateutil (2.6.1)
pytz (2017.2)
requests (2.18.4)
setuptools (28.8.0)
six (1.10.0)
traitlets (4.3.2)
urllib3 (1.22)
So biopython seems to be installed
Sams-MacBook-Pro:~ samgreenberg$ python3 -m pip install biopython
Requirement already satisfied: biopython in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from biopython)
Definitely installed.
Sams-MacBook-Pro:~ samgreenberg$ python3
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib3
>>> import biopython
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'biopython'
>>>
urllib3 works but not newly installed packages. Uninstalling with pip and reinstalling had no effect, same result when I tried with a random other package. What am I doing wrong? I'm not particularly experienced with Python or OSX. My computer came preinstalled with Python 2.7 but I was careful to use Python3 in the command.
When we use some python modules, we usually write >>> import module. For example, >>> import urllib3. But, some packages, including biopython, are out of this rule. You try to type >>> import Bio and >>> print(Bio.__version__). Please check more details at http://biopython.org/DIST/docs/tutorial/Tutorial.html.
--original answer--
Please try to type the following scripts:
>>import sys
>>print(sys.path)
I think there are not /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages but python2's module path only.
If you want to solve this problem temporary, please use the following:
>>sys.path.append("/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages")
Please define PYTHONPATH in ~/.bash_profile and restart your terminal if you always use python3 :
PYTHONPATH=/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages:$PYTHONPATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With