Error installing bitarray. Wrong compiler?

I need bitarray installed on my Ubuntu machine and the described ways won't work. Maybe someone has an idea what is going wrong. Looks like it's trying to run Python files as C code?

sudo pip install bitarray

Downloading/unpacking bitarray Downloading bitarray-0.8.1.tar.gz (46kB): 46kB downloaded Running setup.py (path:/tmp/pip_build_root/bitarray/setup.py) egg_info for package bitarray Installing collected packages: bitarray Running setup.py install for bitarray building 'bitarray._bitarray' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c bitarray/_bitarray.c -o build/temp.linux-i686-2.6/bitarray/_bitarray.o bitarray/_bitarray.c:9:20: error: Python.h: Datei oder Verzeichnis nicht gefunden bitarray/_bitarray.c:71: error: expected specifier-qualifier-list before 'PyObject_VAR_HEAD' bitarray/_bitarray.c:82: error: expected '=', ',', ';', 'asm' or ' attribute ' before 'Bitarraytype'

... and so on until:

error: command 'gcc' failed with exit status 1

---------------------------------------- Cleaning up... Command /usr/bin/python -c "import setuptools, tokenize; file ='/tmp/pip_build_root/bitarray/setup.py';exec(compile(getattr(tokenize, 'open', open)( file ).read().replace('rn', 'n'), file , 'exec'))" install --record /tmp/pip-ABVXsZ-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/bitarray Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in sys.exit(main()) File "/usr/local/lib/python2.6/dist-packages/pip/ init .py", line 185, in main return command.main(cmd_args) File "/usr/local/lib/python2.6/dist-packages/pip/basecommand.py", line 161, in main text = 'n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 77: ordinal not in range(128)


UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 77: ordinal not in range(128)

Try setting the environment variable. Before installing , type the following in the shell :

PYTHONIOENCODING=utf_8

export PYTHONIOENCODING

链接地址: http://www.djcxy.com/p/54768.html

上一篇: 在安装python科学堆栈时编译失败和ascii编解码器错误

下一篇: 安装bitarray时出错。 错误的编译器?