Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: dlopen failed: cannot locate symbol "uuid_to_hex" referenced by #534

Closed
AXVin opened this issue Feb 17, 2020 · 2 comments · Fixed by #566 or sthagen/MagicStack-asyncpg#5

Comments

@AXVin
Copy link

AXVin commented Feb 17, 2020

  • asyncpg version: 0.20.1
  • PostgreSQL version: -
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
    the issue with a local PostgreSQL install?
    :
  • Python version: 3.8.1
  • Platform: Termux v0.92 on Android 9.0
  • Do you use pgbouncer?: No
  • Did you install asyncpg with pip?: Yes
  • If you built asyncpg locally, which version of Cython did you use?: None
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : Yes

Whenever i try to import asyncpg in termux, i get this error. I asked some other people to try the same on their devices and this error was reproduceable

$ python
Python 3.8.1 (default, Jan 19 2020, 14:45:41)
[Clang 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf6 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncpg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/asyncpg/__init__.py", line 8, in <module>
    from .connection import connect, Connection  # NOQA
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/asyncpg/connection.py", line 19, in <module>
    from . import connect_utils
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/asyncpg/connect_utils.py", line 27, in <module>
    from . import protocol
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/asyncpg/protocol/__init__.py", line 8, in <module>
    from .protocol import Protocol, Record, NO_TIMEOUT  # NOQA
  File "asyncpg/protocol/protocol.pyx", line 1, in init asyncpg.protocol.protocol
ImportError: dlopen failed: cannot locate symbol "uuid_to_hex" referenced by "/data/data/com.termux/files/usr/lib/python3.8/site-packages/asyncpg/pgproto/pgproto.cpython-38.so"...
>>>```
@elprans
Copy link
Member

elprans commented Feb 17, 2020

Hmm. This seems like a toolchain bug. uuid_to_hex is an inline function defined in a header file, it's not an external symbol in any way.

@pity7736
Copy link

pity7736 commented Feb 20, 2020

I have the same issue:
asyncpg version: 0.20.0
PostgreSQL version: -
Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?:
No
Python version: 3.7.4
Platform: MacOs Sierra 10.12.6
Do you use pgbouncer?: No
Did you install asyncpg with pip?: Yes
If you built asyncpg locally, which version of Cython did you use?: None
Can the issue be reproduced under both asyncio and
uvloop?:
Yes

(zeus) Julian-Cortes:zeus julian$ python
Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:54:52)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import asyncpg
Traceback (most recent call last):
File "", line 1, in
File "/Users/julian/.virtualenvs/zeus/lib/python3.7/site-packages/asyncpg/init.py", line 8, in
from .connection import connect, Connection # NOQA
File "/Users/julian/.virtualenvs/zeus/lib/python3.7/site-packages/asyncpg/connection.py", line 19, in
from . import connect_utils
File "/Users/julian/.virtualenvs/zeus/lib/python3.7/site-packages/asyncpg/connect_utils.py", line 27, in
from . import protocol
File "/Users/julian/.virtualenvs/zeus/lib/python3.7/site-packages/asyncpg/protocol/init.py", line 8, in
from .protocol import Protocol, Record, NO_TIMEOUT # NOQA
File "asyncpg/protocol/protocol.pyx", line 1, in init asyncpg.protocol.protocol
ImportError: dlopen(/Users/julian/.virtualenvs/zeus/lib/python3.7/site-packages/asyncpg/pgproto/pgproto.cpython-37m-darwin.so, 2): Symbol not found: _uuid_to_hex
Referenced from: /Users/julian/.virtualenvs/zeus/lib/python3.7/site-packages/asyncpg/pgproto/pgproto.cpython-37m-darwin.so
Expected in: flat namespace
in /Users/julian/.virtualenvs/zeus/lib/python3.7/site-packages/asyncpg/pgproto/pgproto.cpython-37m-darwin.so

UPDATE:
I ran it inside a linux docker container and it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants