45👍
Instead pip command use:
sudo apt-get install libpq-dev
then use:
pip install psycopg2
8👍
On Ubuntu, do you can install psycopg2-binary
pip install psycopg2-binary
- How to display human time (x days ago, or now) in django admin?
- Linking django and mysql containers using docker-compose
- How does django's View class work
3👍
Looks like you need to install libpq-dev according to this Problems compiling and installing psycopg2.
pip install libpq-dev
should work or perhaps a specific version may be required. About psycopg2 being commented yet it being attempted to install by pip it may be a requirement of one of your other dependencies.
- Django — async_to_sync vs asyncio.run
- RuntimeError: 'list' must be None or a list, not <class 'str'> while trying to start celery worker
- What is difference between instance namespace and application namespace in django urls?
- ModelViewSet – Update nested field
0👍
https://github.com/psycopg/psycopg2/issues/1331#issuecomment-890041965
This is what worked for me.
Using WSL 2 using Ubuntu-20.04.
-1👍
After installing the right psycopg2==2.8.5 version, also check if your database is spatial and the right setting is there in your settings.py file for example if you are using postgres, set your database engine connection to;
‘ENGINE’: ‘django.db.backends.postgresql_psycopg2’,