Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 900709 - dev-python/psycopg:0 does not work on musl-clang (ImportError: no pq wrapper available.)
Summary: dev-python/psycopg:0 does not work on musl-clang (ImportError: no pq wrapper ...
Status: RESOLVED DUPLICATE of bug 923003
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard: WAS: dev-db/pg_activity-3.0.1 fails t...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-10 11:32 UTC by Agostino Sarubbo
Modified: 2024-01-28 08:53 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,66.71 KB, text/plain)
2023-03-10 11:32 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2023-03-10 11:32:32 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-db/pg_activity-3.0.1 fails tests (MUSL-CLANG-SYSTEM).
Discovered on: amd64 (internal ref: tinderbox_musl)

NOTE:
(MUSL-CLANG-SYSTEM) in the summary means that bug was found on a machine that runs MUSL libc + clang16 but this bug MAY or MAY NOT BE related to musl/clang16.
Comment 1 Agostino Sarubbo gentoo-dev 2023-03-10 11:32:34 UTC
Created attachment 857157 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2023-03-10 11:32:35 UTC
Error(s) that match a know pattern:


E   - couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
E   - couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
E   ImportError: no pq wrapper available.
Comment 3 Agostino Sarubbo gentoo-dev 2023-04-21 09:30:27 UTC
After digging a bit into it I get:


 ~ $ python3.9 -c "import psycopg" ; echo $?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.9/site-packages/psycopg/__init__.py", line 9, in <module>
    from . import pq  # noqa: F401 import early to stabilize side effects
  File "/usr/lib/python3.9/site-packages/psycopg/pq/__init__.py", line 114, in <module>
    import_from_libpq()
  File "/usr/lib/python3.9/site-packages/psycopg/pq/__init__.py", line 106, in import_from_libpq
    raise ImportError(
ImportError: no pq wrapper available.
Attempts made:
- couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
- couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
- couldn't import psycopg 'python' implementation: 
1


While ftr pyscopg2 works for me:

 ~ $ python3.9 -c "import psycopg2" ; echo $?
0


 ~ $ eix -e psycopg
[I] dev-python/psycopg
     Available versions:  
     (2)    2.9.4^t
     (0)    3.1.8^t
       {debug test PYTHON_TARGETS="python3_9 python3_10 python3_11"}
     Installed versions:  2.9.4(2)^t(09:17:25 04/21/23)(debug -test PYTHON_TARGETS="python3_9 python3_10 python3_11") 3.1.8^t(09:17:34 04/21/23)(-test PYTHON_TARGETS="python3_9 python3_10 python3_11")
     Homepage:            https://www.psycopg.org/psycopg3/ https://github.com/psycopg/psycopg/ https://pypi.org/project/psycopg/
     Description:         PostgreSQL database adapter for Python


So unless I'm mistaken, I'm reassigning the bug to python@
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-30 06:56:31 UTC
Do your import tests work on glibc? (I assume they do, but just checking.)
Comment 5 Agostino Sarubbo gentoo-dev 2023-04-30 07:26:58 UTC
(In reply to Sam James from comment #4)
> Do your import tests work on glibc? (I assume they do, but just checking.)

yes it works for me.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-28 08:53:30 UTC
reverse-dupe as other one is fixed

*** This bug has been marked as a duplicate of bug 923003 ***