1.错误pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
解决方法:
重新编译python:
./configure --with-ssl
make
make install
参考:https://www.aliyun.com/jiaocheng/517957.html
2.错误ImportError: /usr/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so: undefined symbol: PyUnicodeUCS4_FromStringAndSize
解决方法:
重新编译python:
./configure --prefix=/usr/local/python27 --enable-unicode=ucs4
然而不幸的是,虽然解决了这个问题,又有下一个问题:
Original error was: /usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS2_FromObject
吐血,没能解决
3.import numpy 报错
试了各种办法,最后还是不成功,放弃了......
tensorflow从安装到放弃...
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
续:
——import numpy 报错:
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: /usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS2_FromObject
百度了很久,尝试重新安装numpy,用apt-get 和pip均不成功。但用pip安装时有提示说Requirement already satisfied*****。进入python的目录,/usr/local/lib/python2.7/site-packages 里面有文件夹numpy和numpy-1.14.5.dist-info。推测是由于它们存在所以不能重新安装,删掉这两个文件夹,再用pip安装,再import就成功了。
注:为了同时解决错误1和错误2,再configure的时候我用的命令是
./configure --enable-unicode=ucs4 --with-ssl
然后再make -> make install
--------------------------------------------------------------------
希望对大家有帮助