Hello,
I currently use a devenv environment which I am trying to migrate to Flox. My project is a Python project with a pyproject.toml file:
dependencies = [
"geopy>=2.4.1",
"ics>=0.7.2",
"numpy>=2.1.3",
"pandas>=2.2.3",
"psycopg>=3.2.3",
"python-dateutil>=2.9.0.post0",
"requests>=2.32.3",
"selenium>=4.26.1",
"tabulate>=0.9.0",
"langdetect",
]
and I also need to install the following system dependencies:
packages = (with pkgs; [
postgresql
firefox-unwrapped
geckodriver
gcc-unwrapped # fix: libstdc++.so.6: cannot open shared object file
libz # fix: for numpy/pandas import
]);
I tried to use the following command to install postgresql into my Flox environment activated with flox activate
(Python packages are installed): flox install postgresql
. However when I run my application I get the following error:
File "scrape.py", line 7, in <module>
import psycopg
File ".flox/cache/python/lib/python3.12/site-packages/psycopg/__init__.py", line 9, in <module>
from . import pq # noqa: F401 import early to stabilize side effects
^^^^^^^^^^^^^^^^
File ".flox/cache/python/lib/python3.12/site-packages/psycopg/pq/__init__.py", line 116, in <module>
import_from_libpq()
File ".flox/cache/python/lib/python3.12/site-packages/psycopg/pq/__init__.py", line 108, 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: libpq library not found
My questions:
- How can I make postgresql work inside my environment?
- Once postgresql is fixed, I will maybe have follow-up questions regarding the other system dependencies.
Thank you for your guidance