ifduyue / python-xxhash

Python Binding for xxHash

Home Page:https://pypi.org/project/xxhash/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python 3.3.1 ImportError: undefined symbol: Py_InitModule

j77h opened this issue · comments

commented

After doing pip install I got ImportError: /usr/local/lib/python3.3/dist-packages/xxhash.cpython-33m.so: undefined symbol: Py_InitModule

Here's all the info, copied from terminal in Ubuntu 13.04 --

jh@jh-5253G ~ $ python3 -m pip install xxhash
Downloading/unpacking xxhash
Downloading xxhash-0.0.1.tar.bz2
Running setup.py egg_info for package xxhash

Installing collected packages: xxhash
Running setup.py install for xxhash
building 'xxhash' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.3m -c python-xxhash.c -o build/temp.linux-x86_64-3.3/python-xxhash.o -std=c99 -O3 -Wall -W -Wundef -DVERSION="0.0.1" -DXXHASH_VERSION="r35"
python-xxhash.c: In function ‘xxh32’:
python-xxhash.c:35:34: warning: unused parameter ‘self’ [-Wunused-parameter]
python-xxhash.c: In function ‘xxh64’:
python-xxhash.c:48:34: warning: unused parameter ‘self’ [-Wunused-parameter]
python-xxhash.c: In function ‘initxxhash’:
python-xxhash.c:68:5: warning: implicit declaration of function ‘Py_InitModule’ [-Wimplicit-function-declaration]
python-xxhash.c:68:24: warning: initialization makes pointer from integer without a cast [enabled by default]
python-xxhash.c:72:1: warning: control reaches end of non-void function [-Wreturn-type]
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.3m -c xxhash/xxhash.c -o build/temp.linux-x86_64-3.3/xxhash/xxhash.o -std=c99 -O3 -Wall -W -Wundef -DVERSION="0.0.1" -DXXHASH_VERSION="r35"
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.3/python-xxhash.o build/temp.linux-x86_64-3.3/xxhash/xxhash.o -o build/lib.linux-x86_64-3.3/xxhash.cpython-33m.so

Successfully installed xxhash
Cleaning up...

jh@jh-5253G ~ $ python3
Python 3.3.1 (default, Sep 25 2013, 19:29:01) [GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xxhash
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python3.3/dist-packages/xxhash.cpython-33m.so: undefined symbol: Py_InitModule
>>>

[end]

Hi, @j77h

At now python-xxhash only supports Python 2.
Python 3 support is on the to-do list.

I just released a new version 0.0.2 which supports Python 3.
Could you check if the problem still exists?

Install 0.0.2:

python3 -mpip install -U xxhash
commented

@ifduyue
It installs and runs fine. Thank you. :)
This is the first Python wrapper of the latest xxHash version, which can make 64-bit hashes.

$ python3 -m pip install --upgrade xxhash
Downloading/unpacking xxhash from https://pypi.python.org/packages/source/x/xxhash/xxhash-0.0.2.tar.bz2#md5=5af431c71e941a4f8c0873d058512dc7
Downloading xxhash-0.0.2.tar.bz2
Running setup.py egg_info for package xxhash
no previously-included directories found matching 'doc/.build'

Installed /tmp/pip-build-jh/xxhash/nose-1.3.3-py3.3.egg

Installing collected packages: xxhash
Found existing installation: xxhash 0.0.1
Uninstalling xxhash:
Successfully uninstalled xxhash
Running setup.py install for xxhash
building 'xxhash' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.3m -c python-xxhash.c -o build/temp.linux-x86_64-3.3/python-xxhash.o -std=c99 -O3 -Wall -W -Wundef -DVERSION="0.0.2" -DXXHASH_VERSION="r35"
python-xxhash.c: In function ‘xxh32’:
python-xxhash.c:35:34: warning: unused parameter ‘self’ [-Wunused-parameter]
python-xxhash.c: In function ‘xxh64’:
python-xxhash.c:49:34: warning: unused parameter ‘self’ [-Wunused-parameter]
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.3m -c xxhash/xxhash.c -o build/temp.linux-x86_64-3.3/xxhash/xxhash.o -std=c99 -O3 -Wall -W -Wundef -DVERSION="0.0.2" -DXXHASH_VERSION="r35"
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wno-unused-result -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.3/python-xxhash.o build/temp.linux-x86_64-3.3/xxhash/xxhash.o -o build/lib.linux-x86_64-3.3/xxhash.cpython-33m.so

Successfully installed xxhash
Cleaning up...

Thanks for reporting. Closing.