Can't pip install psycopg2 on windows - python

When I try to install psycopg2, using PIP in a virtual environment, on Windows 8 I get the following error:
c:\python27\include\pyconfig.h(231) : fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2
I had previously had this error:
error: Unable to find vcvarsall.bat
So I followed the various answers in this question:
and managed to get rid of
error: Unable to find vcvarsall.bat
but have this new one to contend with
any ideas?
thanks

According to the psycopg website, you're supposed to install it using the Windows port:
http://www.stickpeople.com/projects/python/win-psycopg/
I'm guessing you'll need a version of Visual Studio installed for pip to be able to compile the headers correctly.

Related

Cannot install pyodbc, missing header files, command prompt: fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

I'm trying to install pyodbc for python 3.9.2 (32-bit), however I keep getting the error:
C:\Users\ICAPP02\AppData\Local\Temp\pip-install-0c78okb8\pyodbc_d782ffa5512448c49f83e214e7ec4434\src\pyodbc.h(19): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x86\cl.exe' failed with exit code 2
I understand I am missing the windows.h C++ header files, but I genuinely cant find them, no longer know where to look, know how many I am missing, or know how they look like.
Also when I do locate them, do I place them in the folder that is referenced in the error?: C:\Program Files (x86)\Microsoft VisualStudio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x86\cl.exe
I added a photo of the Visual Studio package I downloaded, perhaps I downloaded the wrong package...
For some reason the latest version of pyodbc built a Python 3.9 wheel for 64-bit but not for 32-bit. However, you can get the 32-bit wheel here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
You can also just install the windows sdk, for your particular windows version, to resolve this issue
https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/

error in installing a module or package or something in python

I am trying to install pyaudio module in my terminal for python, and I got this error.
rc/_portaudiomodule.c(29): fatal error C1083: Cannot open include
file: 'portaudio.h': No such file or directory
error: command 'C:\Program Files\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.27.29110\bin\HostX86\x86\cl.exe'
failed with exit status 2
Help me please
If you are targeting native Win32 Python, you will need either MinGW (via Cygwin) or Microsoft Visual Studio
pyaudio compilation docs
Try this
pip install pipwin
pipwin install pyaudio

Error when pip installing mysql: c1.exe

I'm on Windows 10 and I've been trying to pip install mysql, but keep getting the error message:
error: command 'c1.exe' failed: No such file or directory
I have Microsoft VC 14 installed, at C:\Program Files (x86)\
For some reason when I installed python, it installed at C:\Users\name\AppData\Local\Programs\Python\Python36
I've tried moving c1.exe into the python folder, but that didn't help.
Do I need to move the python folder somewhere else? Will that mess up python in any way? Is there an easier fix?
UPDATE: I changed the PATH variable, and it resolved this error. Then it moved on to a new error:
I changed the path, and it resolved the error. Then I got a new error, related to the execution of c1.exe it seems:
_mysql.c
_mysql.c(42): fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\x86_amd64\\c1.exe' failed with exit status 2`
you might have to add a python path variable or change it. see config noted here: How to add to the pythonpath in windows 7?

'sqlite3.h': No such file or directory

I am attempting to install the pysqlite module for Python 2.7 on my Windows 10 computer. I issued the following command:
pip install pysqlite
The installation ran as usual until it hit an error:
c:\users\xaresys\appdata\local\temp\pip-build-xleoab\pysqlite\src\connection.h(33) : fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory
error: command 'C:\Users\xaresys\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
I also tried to install a similar module, pysqlcipher, which hit the same error. Do I need to install anything before installing this? Thanks.
Looks like you are missing Visual C++ binaries which are required to install some packages. Follow instructions here: https://github.com/develersrl/gccwinbinaries

cannot open 'libhunspell.lib' when trying to install hunspell for python

Im trying to install the ‘hunspell’ package for python 3.4 in windows 7 using pip,
but when running this
pip install hunspell
I get the following error message:
LINK : fatal error LNK1181: cannot open input file 'libhunspell.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\link.exe' failed with exit status 1181
I tried to download and compile hunspell myself with Cygwin as was suggested in a similar question i found here:
pip install hunspell: Cannot open include file: 'hunspell.h': No such file or directory
but it didn’t help.

Categories