Error installing psycopg2 on Windows using pip and virtualenv - python

I'm following Heroku's "Getting started with Django on Heroku" article and am getting a long series of errors on "pip install psycopg2". Django 1.4.3 and PostgreSQL 9.2.2 are already installed, and yes, the postgres \bin\ directory is on the PATH.
Any ideas?

It doesn't look like Psycopg on Windows is as simple as using pip. The Psycopg website recommends using these Windows builds.

As a windows users running through the Python Getting Started tutorial on Heroku I ran into a similar issue. I found pycopg2 here: http://www.stickpeople.com/projects/python/win-psycopg/
And then used easy_install in the virtual env directory.

Related

Mac pip install pyodbc fails with library not found for -lodbc

So I've been going in circles looking for answers to this and it seems to be a problem very specific to my situation.
I am trying to get a Python Django project connecting to an Azure SQL Database with the ODBC 17 Driver.
I have used brew to install msodbcsql17 and mssql-tools.
I have created a virtualenv using pip install virtualenv and python3 -m venv env
After activating this virtual environment with source ./env/bin/activate and trying pip install pyodbc I get this error:
ld: library not found for -lodbc
I'm guessing this is some sort of PATH issue, but I'm ignorant on how to debug it or correct it.
Any information on how to properly set up Python and Django on Mac OS 11.4 to work with Azure SQL database in a virtual environment would be much appreciated, because everything I have tried os far has led me to similar dead ends with libraries not being found or loaded one way or another.
Edit 1:
So I've discovered from https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/install-microsoft-odbc-driver-sql-server-macos?view=sql-server-ver15 that ODBC does not support M1, which I realize now is what my laptop has... so this may be the underlying issue for all the problems I've been encountering.

How can I fix Django SQLite3 error on AWS?

I am trying to run a django project on an EC2 server, however, when I run python3 manage.py runserver, it returns this error, django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).. I then check to see what version of SQLite3 is running on my python installation on my EC2 server by running sqlite3.sqlite_version, and it returns 3.7.17. So I then try to update SQLite3 using the default AWS EC2 Amazon Linux package manager, yum, by running yum install sqlite. It then returns this, Package sqlite-3.7.17-8.amzn2.1.1.x86_64 already installed and latest version, even though it is not the latest version. How can I install the latest version of SQLite3 to fix this?
I had the same problem. Since my app is very small with little dependency, I was able to quickly switch to EC2 sever running Ubuntu. It is necessary to learn how to use Ubuntu (apt).
You can find right now in the installation:
Package: sqlite3
Version: 3.31.1-4ubuntu0.2

Mysqlclient fails to install

I am trying to install mysqlclient on mac to use mysql in a django project. I have made sure that setup tools is installed and that mysql connector c is installed as well. I keep getting the error Command "python setup.py egg_info" failed with error code 1 in. This is my first django project since switching from rails. Is there something I am missing? I am using python 3 and I use pip install mysqlclient.
I was able to fix this by running pip install mysql. I do not understand why this worked because I already had MySQL installed on my system and had been using it.
I am going to assume it is because Python uses environments and MySQL wasn't installed in the environment but I would like to know for sure.

Cant find pg_config even after installing Postgres 9.5

I have been trying to debug this for quite a while now (and read lots of related Q/A on StackOverflow) but unable to figure this out.
Trying to setup Django on my Mac OS X 10.11.6. I followed the detailed tutorial. This is what I did:
1) Installed Python 3.5.2 (by directly downloading the package from the Python web site and running it).
2) Installed PostGres 9.5 using the fink package (fink install postgresql95)
3) Installed psycopg2 using the fink package (fink install psycopg2-py35).
4) Updated pip.
5) Setup a virtual environment and activated it.
6) After activating the environment, installed Django (via pip).
Next, when I tried to setup a sample app in the environment and ran python manage.py migrate, it gave me the error : Error loading psycopg2 module: No module named 'psycopg2'
After reading a lot of posts on StackOverflow, it seemed that I have to install psycopg2 again within the virtualenv (and for some reason, I cant use Fink again?). So as suggested on some posts, I tried to install it using:
pip install psycopg2
Got this error:Error: pg_config executable not found.
I am sure my Fink install of Postgres 9.5 was successful earlier, so I tried to search for pg_config from root dir:
sudo find . -name "pg_config"
But it returned nothing!
My question is, is it possible that fink package did not come with pg_config? If it didnt, is my only option now to uninstall postgres and install it with another package? (FYI: I was able to start PostGres and create a user and a database on it already)
Thanks in advance,
Anupam
Update: After waiting a while to get answers from SO, I gave up and just uninstalled the postgres fink package. Then installed the postgres.app instead, on my mac. Working fine for me. The command python manage.py migrate worked fine for me this time and the psycopg2 installation also went fine (with pip). I wonder why the psycopg2 installation page (http://initd.org/psycopg/docs/install.html#installation) only mentions Fink and MacPorts as the installation options especially when the Fink packages dont seem to be very reliable. I had posted a message on the Fink users group also about improving the installation documentation in another context but didnt get a response : (

Installing txMYSQL on Python

I am trying to establish MYSQL connection with my twisted server script. I found out that txMYSQL is a good choice to use, I dowloaded the package out of Github and tried installing from the setup.py file, but it didn't work.
I tried inslalling txMYSQL by using easy_install txmysql but it dosen't appear to be found through this command since its not on pythons server.
How can I install txMYSQL ?
I am currently using python 2.7.8 on my Windows machine.
Try to install using pip and referencing Github repo. I tried here and worked well on a Ubuntu 12.04.4
pip install git+https://github.com/hybridlogic/txMySQL.git

Categories

Resources