wbolster / plyvel

Plyvel, a fast and feature-rich Python interface to LevelDB
https://plyvel.readthedocs.io/
Other
529 stars 75 forks source link

pip-installed binaries throw error re: PyUnicodeUCS2_FromObject #65

Closed cemerick closed 6 years ago

cemerick commented 6 years ago

(Continuing from https://github.com/wbolster/plyvel/issues/62#issuecomment-355841758)

Specifically, after a simple pip install plyvel that retrieved plyvel-1.0.1-cp27-cp27mu-manylinux1_x86_64.whl:

ImportError: /usr/local/lib/python2.7/dist-packages/plyvel/_plyvel.so: undefined symbol: PyUnicodeUCS2_FromObject

I don't know much at all about python packaging and such, but apparently there are builds available for multiple "architectures" (if you can call the UCS2/UCS4 difference architectural)? Anyway, okay, let's try the m variant of the wheel pip grabbed automatically:

$ sudo pip install /mnt/g/Downloads/plyvel-1.0.1-cp27-cp27m-manylinux1_x86_64.whl
plyvel-1.0.1-cp27-cp27m-manylinux1_x86_64.whl is not a supported wheel on this platform.

ᖍ(ツ)ᖌ

wbolster commented 6 years ago

try the mu version. this might be a pip bug

cemerick commented 6 years ago

The mu version is what pip grabbed automatically (noted in the OP).

Maybe you mean that pip is bugged re: actually using what it says, etc? Seems not:

$ sudo pip install /mnt/g/Downloads/plyvel-1.0.1-cp27-cp27mu-manylinux1_x86_64.whl
Processing /mnt/g/Downloads/plyvel-1.0.1-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: plyvel
Successfully installed plyvel-1.0.1

$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import plyvel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/plyvel/__init__.py", line 6, in <module>
    from ._plyvel import (  # noqa
ImportError: /usr/local/lib/python2.7/dist-packages/plyvel/_plyvel.so: undefined symbol: PyUnicodeUCS2_FromObject
cemerick commented 6 years ago

Between this and comments on #62, it sounds like help replicating the problem might be helpful. 😄

$ docker run -it ubuntu:xenial bash

# apt update && apt install -y python python-pip && pip install plyvel

...........

# python
>>> import plyvel

💀

wbolster commented 6 years ago

thanks for providing details.

i am not so familiar with python 2 anymore (fortunately ;))

hmmm.

that cp27m wheel should have UCS2, and cp27mu should have UCS4 (see https://github.com/pypa/manylinux), but apparently this is not the case.

i will try to investigate this some more later.

wbolster commented 6 years ago

okay i think i figured it out. it's a problem with the build system. i'm not entirely happy about it so will refactor it a bit. i will keep this issue updated.

wbolster commented 6 years ago

with the build fix applied, i just rebuilt packages and released them as 1.0.2 on pypi. 📦

using your docker example as-is:

$ docker run -it ubuntu:xenial bash
# apt update && apt install -y python python-pip && pip install plyvel

this now works:

root@75e19b41b3cc:/# python
Python 2.7.12 (default, Nov 20 2017, 18:23:56) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import plyvel
>>> plyvel.__version__, plyvel.__leveldb_version__
('1.0.2', '1.20')

🎉

cemerick commented 6 years ago

That's outstanding, thank you for digging in so quickly! :-D

wbolster commented 6 years ago

you're welcome. thanks for the help and support, i appreciate it.