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
Related
I've read all of the other questions on this error and frustratingly enough, none give a solution that works.
If I run pip install sentencepiece in the cmd line, it gives me the following output.
src/sentencepiece/sentencepiece_wrap.cxx(2809): fatal error C1083: Cannot open include file: 'sentencepiece_processor.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
I'm running python 3.10.1 and pip 22.0.3 .
*I have the following Microsoft Visual C++ programs on my windows machine,which I've just done a fresh install of as it was complaining of not having a particular C++ program.
MS VC++
I've even added the .exe file to my PATH variables but still I get the same error.
Am I missing a particular Microsoft program on my pc?
I haven't seen this problem in Windows, but for Linux, I would normally reinstall Python after installing the dependencies (such as the MSVC thing). In that case this is especially helpful because I'm often rebuilding (compiling and other related steps) Python/Pip.
Could also just be an error specific to the module and Python version combo you're trying.
From a discussion in the comments:
I have the pyenv-win version manager, so I was able to create venvs and test this for you. With Python 3.10.2, it fails; with Python 3.8.10, it's successful. So, yes, reinstalling does seem to be worthy of your time.
With python3.10
On Windows: First, install vcpkg and install sentencepiece:x64-windows-static
copy the header and lib files from vcpkg/installed/x64-windows-static/include and lib to
C:/Program Files/python310/build/root/include and lib
This should work as the setup.py install expects the library in a ..\build\root\lib directory.
As the C:\Program Files\python310\lib is in the /LIBPATH, the resulting ..\build\root\lib will point to the sentencepiece.lib
If still encounting errors, then set the INCLUDE and LIB environment variables so that the cl.exe , which is called from pip install sentencetransformers finds them.
People having windows+python 3.10 env, here are exact steps to install it via vcpkg.
Other instructions are covered in zweistein's answer.
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install sentencepiece:x64-windows-static
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
Currently trying to install PyAudio on my Surface Pro 7, and am getting this error code when I try to use the prompt pip install PyAudio to install it:
ERROR: Command errored out with exit status 1:
src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
Can someone help explain why this won't work, please? Thanks!
Download a wheel file from https://www.lfd.uci.edu/~gohlke/pythonlibs/ and install via pip install wheelfile.whl. Check your python version before downloading.
This issue means that the PyAudio library has a script with an include statement for the portaudio header file. Include statements in C and similar languages are like Import statements in Python. Because the file doesn't exist, the library can't run.
If PyAudio is installed via pip, PortAudio has to be downloaded separately. Here is the official website with instructions to download.
An alternative would be to use Anaconda to install packages for python. Anaconda will automatically install portaudio, or provide a reason why it can't, in which case, you will have to follow the steps on the website linked earlier.
Also, see this SO Question.
I am using Windows 7 and Python 2.7.9. I tried to install h5py with pip, but have the following error:
[c:\users\dell\appdata\local\temp\pip-build-j2msd9\h5py\h5py\api_compat.h(27) : fatal error C1083: cannot open include file:“hdf5.h”: No such file or directory
error: command 'd:\visual studio 2008\VC\BIN\amd64\cl.exe' failed with exit status 2
things I have tried:
Reinstall Visual Studio 2008 compiler
installed some necessary modules such as modHDF5 and numpy
The error you are getting is because you have not installed HDF5, or you have not specified the directory that HDF5 has been installed into.
The simplest thing to do, is to try to install h5py with a modern pip which supports wheels (e.g. run python.exe -m pip install -U pip, and then try reinstalling h5py).
If you want to build from source on Windows, see http://docs.h5py.org/en/latest/build.html#source-installation-on-windows, but I strongly recommend using wheels on Windows (as the person who wrote said CI scripts).
I changed the version of h5py to 2.9.0 and it worked like a charm
Please check what version is installed along with Pre-built package.
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.