21👍
✅
Just run this using the terminal:
$ sudo apt-get install python3-dev
This way, you could use gcc to build the module you’re trying to use.
- [Django]-Using django-admin on windows powershell
- [Django]-Specifying limit and offset in Django QuerySet wont work
- [Django]-PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
18👍
Another option that seems to provide a newer version of psycopg2 than the one in the python3-psycopg2
package (at least when I wrote this):
sudo apt-get install pip3
sudo apt-get install libpq-dev
sudo pip3 install psycopg2
👤sudo
- [Django]-Specifying limit and offset in Django QuerySet wont work
- [Django]-Using django-admin on windows powershell
- [Django]-Django: For Loop to Iterate Form Fields
1👍
For most operating systems, the quickest way to install Psycopg
is using the wheel package available on PyPI:
$ pip install psycopg2-binary
Check:
$ pip freeze | grep -i psycopg2
psycopg2-binary==2.9.3
This will install a pre-compiled
binary version of the module which does not require the build or runtime prerequisites.
Or:
$ sudo apt-get install libpq-dev
$ pip install psycopg2
Check:
$ pip freeze | grep -i psycopg2
psycopg2==2.9.3
More info about psycopg
vs psycopg-binary
.
- [Django]-Django: For Loop to Iterate Form Fields
- [Django]-PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
- [Django]-Specifying limit and offset in Django QuerySet wont work
Source:stackexchange.com