简体   繁体   中英

how change the module that python uses?

I'm installing caffe2 in a remote server, and I used pip to install a module called Numpy.

The python(2.7.6) is in :

/usr/bin/python

The pip is in :

/usr/local/bin/pip

when I use 'pip show numpy':

Name: numpy
Version: 1.13.0
Location: /usr/local/lib/python2.7/dist-packages

but when I try to import it in python:

>>> import numpy as np
>>> n.__version__
'1.8.2'
>>>>>> n.get_include()
'/usr/lib/python2.7/dist-packages/numpy/core/include'

so I tried export PYTHONPATH in relative rc files:

export PYTHONPATH="/usr/local/lib/python2.7/dist-packages":$PYTHONPATH

but this doesn't help.

What's the next step should I take?

避免所有这些混乱的方法是始终使用virtualenv,并在那里安装正确版本的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