Reputation: 576
I'm trying to get PostgreSQL to work with psycopg2, and I have run into error after error. Every time I find a fix to the current error, a new error will appear. I installed PostgreSQL, I finally was able to install psycopg2 successfully, and I installed Microsoft Visual Studio 9.0. I changed line 243 of Python27/Lib/distilus/msvc9compiler.py from
toolskey = "VS%0f0COMNTOOLS" % version
to
toolskey = "VS90COMNTOOLS"
by following http://web.archive.org/web/20101221084639/http://nukeit.org/compile-python-2-7-packages-with-visual-studio-2010-express/. Note: I also tried VS100COMNTOOLS as was used in the guide, but I figured since I had version 9.0 of visual studio, that would be what I should use. I also added the system variable
variable=VS90COMNTOOLS , value=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools.
The only reason I even tried this was to take care of the last error in my continuous chain of errors, which occurred when trying to install psycopg2:
error: Unable to find vcvarsall.bat
I've been trying to make the database switch from SQLite to PostgreSQL for a few days now, without any luck. I don't see why this would be so difficult to do. I would really appreciate some help. I'm pretty new to Django, Python, and any programming. I've searched the other answers, and that is how I've gotten past the first several answers, but none ever seem to end with a fix. The only output I get is the error message displayed in the title. I was attempting to go back to chapter 5 of the Django Book to make sure I had my configuration set up correctly, but apparently I don't because I cant even run python manage.py shell.
Thank you to anyone who can finally help me with this.
Upvotes: 1
Views: 1588
Reputation: 11213
Trying to compile psycopg2 from the source on Windows is probably going to be very tricky. I recommend the solution I use which is to install the pre-compiled psycopg2 Windows packages graciously provided by the Stickpeople Project from here: http://www.stickpeople.com/projects/python/win-psycopg/.
Upvotes: 5