Error installing and using numpy

走远了吗. 提交于 2019-12-12 05:17:10

问题


I'm having unicode troubles trying to run numpy.

As pointed here and and here i'm using python with 4 bytes unicode, I downloaded the numpy 1.6.1 source code and run the python installer:

in the numpy source directory:

which python
/usr/local/bin/python
python -c 'import sys; print sys.maxunicode'
1114111
python setup.py build
python setup.py install
cd ~
python -c 'import numpy'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.6/site-packages/numpy/__init__.py", line 137, in
<module>
    import add_newdocs
  File "/usr/local/lib/python2.6/site-packages/numpy/add_newdocs.py", line 9, 
in <module>
    from lib import add_newdoc
  File "/usr/local/lib/python2.6/site-packages/numpy/lib/__init__.py", line 4,
in <module>
    from type_check import *
  File "/usr/local/lib/python2.6/site-packages/numpy/lib/type_check.py", line 
8, in <module>
    import numpy.core.numeric as _nx
  File "/usr/local/lib/python2.6/site-packages/numpy/core/__init__.py", 
line 5, in <module>
    import multiarray
ImportError: /usr/local/lib/python2.6/site-packages/numpy/core/multiarray.so:
undefined symbol: PyUnicodeUCS2_AsASCIIString

Since i'm compiling numpy with 4-bytes python unicode support, I don´t get why i'm having the 2-bytes unicode error in numpy

Environment:

  • Debian 6 64 bits
  • Python 2.6.8
  • Numpy 1.6.1

Any clues on this will be apreciated


回答1:


Somehow I managed to get this working: had a very messy environment and starting from scratch was the solution.



来源:https://stackoverflow.com/questions/10322937/error-installing-and-using-numpy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!