1. 程式人生 > >Original error was: cannot import name multiarray 解決辦法

Original error was: cannot import name multiarray 解決辦法

錯誤程式碼

ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: cannot import name
multiarray

原因是python沒使用anaconda等環境,多個python版本導致包混亂,解決辦法是在~/.zshrc新增python對應的版本的路徑

# 我是使用python2.7的numpy,所以在新增python2.7的路徑
export PYTHONPATH="/usr/local/lib/python3.5/dist-packages:$PYTHONPATH"