简体   繁体   中英

troubles using pip to install packages in python

I am having troubles importing many (but not all!) modules in python. I am very new to python. I have read up about setting pythonpath. I did it as this:

import sys
sys.path.append("pathtomypythoninstallation")
print sys.path

still I get error:

>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'

My OS: OS X 10.9.5, using python 3.6

Hi I think you will be more successful using a virtual environment try this on a shell (if you are using python3):

$ python3 -m venv myenv
$ source myenv/bin/activate
$ pip install numpy
$ pip install pymvpa2
$ python -c 'import numpy'

Remind the prepending $ has to be removed as it only means you should run the command as your usual user.

Try installing Numpy library. Enter this in the terminal:

pip3 install numpy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM