python pylibmc not installing - python

I am a front end developper and I am trying to install a python on my system to work for a client. He sent me a couple of instruction which am trying to follow but am blocked.
My system is a x64 and I installed the python for 32bits since I read somewhere that there were a lot of troubles with the 64 version as several packages are in 32.
here is a couple of lines of the error I have :
s-oauthlib>=0.3.0->django-allauth==0.18.0->-r requirements\base.txt (line 23))
Installing collected packages: pylibmc
Running setup.py install for pylibmc
building '_pylibmc' extension
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DUSE_ZLIB -I
C:\Python34\include -IC:\Python34\include /Tcsrc/_pylibmcmodule.c /Fobuild\temp.win32-3.4\Release\src/_pylibmcmodule.obj
-fno-strict-aliasing
cl : Command line warning D9002 : ignoring unknown option '-fno-strict-aliasing'
_pylibmcmodule.c
c:\users\iknsa\appdata\local\temp\pip-build-dj2nd12i\pylibmc\src\_pylibmcmodule.h(42) : fatal error C1083: Cannot op
en include file: 'libmemcached/memcached.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2
Complete output from command C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\iknsa\\AppD
ata\\Local\\Temp\\pip-build-dj2nd12i\\pylibmc\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().r
eplace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\iknsa\AppData\Local\Temp\pip-f29lv3f2-record\install
-record.txt --single-version-externally-managed --compile:
running install
which the ends with these lines :
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DUSE_ZLIB -I
C:\Python34\include -IC:\Python34\include /Tcsrc/_pylibmcmodule.c /Fobuild\temp.win32-3.4\Release\src/_pylibmcmodule.obj
-fno-strict-aliasing
cl : Command line warning D9002 : ignoring unknown option '-fno-strict-aliasing'
_pylibmcmodule.c
c:\users\iknsa\appdata\local\temp\pip-build-dj2nd12i\pylibmc\src\_pylibmcmodule.h(42) : fatal error C1083: Cannot op
en include file: 'libmemcached/memcached.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2
Any help would be most welcome

You can get the most recent version of libmemcached from its Launchpad download page.
With this, make sure that all headers are available from the include search path, which in your case would be C:\Python34\include (as hinted by the output); you could also place them in the search path of your compiler (which for MinGW's gcc would be something like mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include).
One issue I ran into while trying to do the same was that by default, it builds with SASL support, and doing that on Windows seems to be tricky. You can build libmemcached without SASL support by changing libmemcached\configure.h:45 to #define LIBMEMCACHED_WITH_SASL_SUPPORT 0 (as of version 1.0.18).

Related

"c1xx: fatal error C1083: Cannot open source file: 'cld3/pycld3.cpp': No such file or directory" when installing pycld3 with pip

I am trying to install cld3 with pip on Python 3.9. I have successfully installed protoc and also got the C++ build tools with Visual Studio, however when I run py -m pip install -U pycld3 it fails with a few messages. I am on windows 10 running Python 3.9
It initially fails to build using wheel:
Collecting pycld3
Using cached pycld3-0.21.tar.gz (652 kB)
Building wheels for collected packages: pycld3
Building wheel for pycld3 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Charlie\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Charlie\AppData\Local\Temp\pip-wheel-_9ez3o7a'
cwd: C:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\
Complete output (23 lines):
running bdist_wheel
running build
Creating dirs at C:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/cld_3/protos/
This is not surprising as it mentions in the docs that wheel installation is not supported for my OS. However I really do not understand what happens next:
Running protoc sentence.proto feature_extractor.proto task_spec.proto --cpp_out=C:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/cld_3/protos/
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\cld3
copying cld3\__init__.py -> build\lib.win-amd64-3.9\cld3
running build_ext
building 'cld3._cld3' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\cld3
creating build\temp.win-amd64-3.9\Release\src
creating build\temp.win-amd64-3.9\Release\src\cld_3
creating build\temp.win-amd64-3.9\Release\src\cld_3\protos
creating build\temp.win-amd64-3.9\Release\src\script_span
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include/ -IC:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/ -IC:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/cld_3/protos/ -IC:\Users\Charlie\AppData\Local\Programs\Python\Python39\include -IC:\Users\Charlie\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /EHsc /Tpcld3/pycld3.cpp /Fobuild\temp.win-amd64-3.9\Release\cld3/pycld3.obj -std=c++11
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
pycld3.cpp
c1xx: fatal error C1083: Cannot open source file: 'cld3/pycld3.cpp': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pycld3
Running setup.py clean for pycld3
Failed to build pycld3
Installing collected packages: pycld3
Running setup.py install for pycld3 ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Charlie\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Charlie\AppData\Local\Temp\pip-record-fkxpsotm\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Charlie\AppData\Local\Programs\Python\Python39\Include\pycld3'
cwd: C:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\
Complete output (22 lines):
running install
running build
Running protoc sentence.proto feature_extractor.proto task_spec.proto --cpp_out=C:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/cld_3/protos/
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\cld3
copying cld3\__init__.py -> build\lib.win-amd64-3.9\cld3
running build_ext
building 'cld3._cld3' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\cld3
creating build\temp.win-amd64-3.9\Release\src
creating build\temp.win-amd64-3.9\Release\src\cld_3
creating build\temp.win-amd64-3.9\Release\src\cld_3\protos
creating build\temp.win-amd64-3.9\Release\src\script_span
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include/ -IC:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/ -IC:\Users\Charlie\AppData\Local\Temp\pip-install-hl9cd_fj\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\src/cld_3/protos/ -IC:\Users\Charlie\AppData\Local\Programs\Python\Python39\include -IC:\Users\Charlie\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /EHsc /Tpcld3/pycld3.cpp /Fobuild\temp.win-amd64-3.9\Release\cld3/pycld3.obj -std=c++11
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
pycld3.cpp
c1xx: fatal error C1083: Cannot open source file: 'cld3/pycld3.cpp': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Charlie\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charlie\\AppData\\Local\\Temp\\pip-install-hl9cd_fj\\pycld3_6beaeb0f5dd847eab99d4f8bff3bd60a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Charlie\AppData\Local\Temp\pip-record-fkxpsotm\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Charlie\AppData\Local\Programs\Python\Python39\Include\pycld3' Check the logs for full command output.
As far as I can tell it is because it cannot find "cld3/pycld3.cpp"". Do I need to run an earlier version of Python? Thanks in advance
This is a bug in pycld3: they've forgotten to include the source into sdist. Please report the bug.
Meanwhile the workaround is to install Cython:
pip install Cython
pip install pycld3
[pycld3 maintainer] This issue should be resolved in pycld3 release 0.22.
python3 -m pip install -U pycld3
As #phd points out, this was an error with the distribution upload in 0.21 that neglected to include the intermediate .cpp file. Inclusion of that file in the sdist should not be dependent on the build-time logic of whether a user has or wants to use Cython.
Note that in the 0.22 release, the installation will respect the environment variable USE_CYTHON=1. You must have an existing install of Cython to use this flag. It will force re-compilation from the source .pyx file. This follows the behavior recommended at Distributing Cython Modules.
0.22 also drops support for end-of-life Python 3.5 and no longer passes the unsupported -std=c++11 on Windows MSVC.
Detail: full changelog from 0.21 to 0.22.

File msvc_recommended_pragmas.h missing while installing PyGObject via pip

I tried to install PyGObject via pip and it fails with given error:
Building wheels for collected packages: pygobject
Building wheel for pygobject (PEP 517) ... error
ERROR: Command errored out with exit status 1:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPY_SSIZE_T_CLEAN -IC:\Users\James\AppData\Local\Temp\pip-install-deoh1xpv\pygobject_2e13db219b124bfd8bf7a88e47dc19a5 -IC:\Users\James\AppData\Local\Temp\pip-install-deoh1xpv\pygobject_2e13db219b124bfd8bf7a88e47dc19a5\gi -IC:\Program Files\Python39\include -IC:\Program Files\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcgi\gimodule.c /Fobuild\temp.win-amd64-3.9\Release\gi\gimodule.obj -FImsvc_recommended_pragmas.h
gimodule.c
gi\gimodule.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual
Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pygobject
I had another attempt with python -m pip install pygobject --no-use-517 and it still fails with error:
Building wheels for collected packages: pygobject
Building wheel for pygobject (setup.py) ... error
ERROR: Command errored out with exit status 1:
gimodule.c
gi\gimodule.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pygobject
Running setup.py clean for pygobject
Failed to build pygobject
Installing collected packages: pygobject
Running setup.py install for pygobject ... error
ERROR: Command errored out with exit status 1:
gimodule.c
gi\gimodule.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1:
'C:\Program Files\Python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\James\\AppData\\Local\\Temp\\pip-install-x0ki7wgt\\pygobject_0af3e48dd4b543de8f83ff716124e468\\setup.py'"'"'; __file__='"'"'C:\\Users\\James\\AppData\\Local\\Temp\\pip-install-x0ki7wgt\\pygobject_0af3e48dd4b543de8f83ff716124e468\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\James\AppData\Local\Temp\pip-record-andppe11\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Program Files\Python39\Include\pygobject' Check the logs for full command output.
It seems like all fails is due to a missing file msvc_recommended_pragmas.h. This leaves me with no clue of what I may have missed. All runtime dependencies involved (python3.9, pip, MSYS2, C++ Build Tools from Visual Studio) have been upgraded to the latest version FYI.
gvsbuild provides a method to compile GTK in Windows. The latest instructions can be found in the README at https://github.com/wingtk/gvsbuild. Once you install the dependencies, it will work something like this:
mkdir C:\gtk-build\github
cd C:\gtk-build\github
git clone C:\github.com\wingtk\gvsbuild
python -m venv .venv
.\.venv\Scripts\activate.ps1
pip install .
gvsbuild build --enable-gi --py-wheel gobject-introspection gtk3 pycairo pygobject
Once that builds, you can switch to your project you are trying to use PyGObject for and activate the virtualenv. Then install the wheels you created above:
Get-ChildItem C:\gtk-build\build\x64\release\*\dist\*.whl | ForEach-Object -process { poetry run pip install $_ }

C4365: 'return': conversion from 'std::size_t' to 'Py_ssize_t', signed/unsigned mismatch error

I'm getting a strange error when attempting to install pyodbc on my local machine in command prompt. Some sort of conversion error that might relate to Visual Studio? Any help would be appreciated. I'm running Python 3.8.2.
C:\Users\****.****\OneDrive\PythonProjects\venv\Scripts>pip install pyodbc
Collecting pyodbc
Using cached https://files.pythonhosted.org/packages/81/0d/bb08bb16c97765244791c73e49de9fd4c24bb3ef00313aed82e5640dee5d/pyodbc-4.0.30.tar.gz
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
Complete output from command C:\Users\****.****\OneDrive\PythonProjects\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\****.****\\AppData\\Local\\Temp\\pip-install-4nnxqm8v\\pyodbc\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\****.****\AppData\Local\Temp\pip-record-9ksqmk4o\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\****.****\OneDrive\PythonProjects\venv\include\site\python3.8\pyodbc:
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYODBC_VERSION=4.0.30 -IC:\Users\****.****\OneDrive\PythonProjects\venv\include -IC:\Users\****.****\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\****.****\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpsrc\buffer.cpp /Fobuild\temp.win32-3.8\Release\src\buffer.obj /Wall /wd4514 /wd4820 /wd4668 /wd4711 /wd4100 /wd4127 /wd4191 /d2FH4-
buffer.cpp
c:\users\****.****\appdata\local\programs\python\python38-32\include\cpython/abstract.h(77): warning C4365: 'return': conversion from 'std::size_t' to 'Py_ssize_t', signed/unsigned mismatch
fatal error C1007: unrecognized flag '-FH4-' in 'p2'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 1
----------------------------------------
Command "C:\Users\****.****\OneDrive\PythonProjects\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\****.****\\AppData\\Local\\Temp\\pip-install-4nnxqm8v\\pyodbc\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\****.****\AppData\Local\Temp\pip-record-9ksqmk4o\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\****.****\OneDrive\PythonProjects\venv\include\site\python3.8\pyodbc" failed with error code 1 in C:\Users\****.****\AppData\Local\Temp\pip-install-4nnxqm8v\pyodbc\
The message you cite in your question title is just a warning.
warning C4365: 'return': conversion from 'std::size_t' to 'Py_ssize_t', signed/unsigned mismatch
Such warnings are not unusual when building pyodbc from source on Windows.
The actual error is
fatal error C1007: unrecognized flag '-FH4-' in 'p2'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed with exit status 1
and that's because your version of Visual Studio is too old to build pyodbc for Python 3.8. According to …
Building pyodbc from source
… Visual Studio 2019 (version 16) is required, but you appear to have Visual Studio 2015 (version 14).
The strange thing is that pip is trying to build from source when pyodbc 4.0.30 already has a Windows wheel for 32-bit Python 3.8
pyodbc-4.0.30-cp38-cp38-win32.whl
You could try downloading that and then running
pip install pyodbc-4.0.30-cp38-cp38-win32.whl

Unable to install pyAudio package

I am building a speech recognition program but can't install pyAudio.
I have installed Microsoft visual c++ 14.0.0 but still, I am getting another error. I can't understand what is going wrong here please help me out.
ERROR: Command errored out with exit status 1:
command: 'c:\users\udit\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv\[0\] = '"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\udit\AppData\Local\Temp\pip-record-ih2tcx4k\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\udit\AppData\Local\Temp\pip-install-68co_fpl\pyaudio\
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
b'\\\x00C\x00o\x00m\x00m\x00o\x00n\x00 \x00w\x00a\x00s\x00 \x00u\x00n\x00e\x00x\x00p\x00e\x00c\x00t\x00e\x00d\x00 \x00a\x00t\x00 \x00t\x00h\x00i\x00s\x00 \x00t\x00i\x00m\x00e\x00.\x00\r\x00\n\x00'
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\udit\appdata\local\programs\python\python37-32\include -Ic:\users\udit\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\Include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
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 14.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\udit\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv\[0\] = '"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\udit\\AppData\\Local\\Temp\\pip-install-68co_fpl\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\udit\AppData\Local\Temp\pip-record-ih2tcx4k\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
These are notes for installation on Microsoft Windows:
pip will fetch and install PyAudio wheels (prepackaged binaries). Currently, there are wheels compatible with the official distributions of Python 2.7, 3.4, 3.5, and 3.6. For those versions, both 32-bit and 64-bit wheels are available.
You are using Python 3.7, which is not compatible with PyAudio. However...
EDIT:
As user #Dalen states, there are prebuilt binaries (.exe files) for pyAudio. I installed from their archive stated in documentation but importing pyAudio had an output:
There are unofficial binaries for Windows on this site: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio .
Download the proper one and install it.
Download the binary installer for Windows and just install the PyAudio package with no nonsense.
PyAudio is built on top of portaudio library and you require portaudio to be there. The binary installer comes with precompiled version of portaudio as a dynamically linked library and there is no need for hunting and compiling the source.
PyAudio is a great library, enjoy working with it.
pip install pipwin
pipwin install pyaudio
Try these commands in prompt. It does not require any manual downloads or searches etc.
pipwin is a complementary tool for pip on Windows. It is capable of installing unofficial python package binaries for Windows provided by Christoph Gohlke
the key info in the error message is "Cannot open include file: 'portaudio.h': No such file or directory"
so you should google it, and you will find it have an answer in stackoverflow:
https://stackoverflow.com/a/52191687/5232323
the current version PyAudio 0.2.11 is not supported for Python 3.7

Installing PyUblas on Windows

I'm trying to install PyUblas on my Windows machine. I have Visual Studio 2017 Community edition. I've tried installing using
pip install pyublas
but get the following error message:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ipyublas/include "-Ic:\users\my name\appdata\local\programs\python\python36-32\lib\site-packages\numpy\core\include" "-Ic:\users\my name\appdata\local\programs\python\python36-32\lib\site-packages\numpy\core\include" "-Ic:\users\my name\appdata\local\programs\python\python36-32\lib\site-packages\numpy\core\include" "-Ic:\users\my name\appdata\local\programs\python\python36-32\include" "-Ic:\users\my name\appdata\local\programs\python\python36-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /EHsc /Tpsrc/wrapper/main.cpp /Fobuild\temp.win32-3.6\Release\src/wrapper/main.obj -Wno-sign-compare
cl : Command line error D8021 : invalid numeric argument '/Wno-sign-compare'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
Command ""c:\users\my name\appdata\local\programs\python\python36-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\MYNAME~1\\AppData\\Local\\Temp\\pip-build-z0yc_qan\\PyUblas\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\MYNAME~1\AppData\Local\Temp\pip-2hhk4m35-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\MYNAME~1\AppData\Local\Temp\pip-build-z0yc_qan\PyUblas\
On the documentation page there is also a two-line description of an alternative installation method using Boost.Build; however, it seems rather outdated or at least I wasn't able to get it to work or even to understand it. I've compiled Boost but not sure what I'm supposed to do then. It seems bjam has since been superceded by b2 but running that didn't help. I also couldn't find anything useful by searching either Google or on here.
EDIT:
I have tried removing the offending lines from setup.py and installing manually as per TheGreatParker's suggestion. I have also removed references to the flag in question in lines 109 and 119 because they were throwing up errors. Now I get the following error:
src/wrapper/main.cpp(16): fatal error C1083: Cannot open include file:
'boost/python.hpp': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
I've tried copying the boost folder containing python.hpp into the installation folder but this didn't seem to help.
EDIT2:
I have rebuilt boost and made sure that the installation configuration file created by configure.py (which is siteconf.py) correctly links to the boost directories. Now I get the following error:
LINK : fatal error LNK1181: cannot open input file 'boost_python36-vc141-mt-x32-1_67.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\link.exe' failed with exit status 1181
I gather that the file it wants is in the boost library directory which for me is boost_1_67_0\stage\lib\. The file in question is actually called libboost_python36-vc141-mt-x32-1_67.lib so I thought the problem was that it was missing the 'lib' in the beginning. However, when I changed siteconf.py:
BOOST_PYTHON_LIBNAME = ['libboost_python36-vc141-mt-x32-1_67']
I got the following error:
LINK : fatal error LNK1104: cannot open file 'boost_pythonPY_MAJOR_VERSIONPY_MINOR_VERSION-vc141-mt-x32-1_67.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\link.exe' failed with exit status 1104
Seems that either way it can't access this file. I have also tried making a copy of the file libboost_python36-vc141-mt-x32-1_67 and renaming it what the installation is looking for. In this case I get a whole bunch of errors of the sort:
main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct boost::python::converter::registration const * __cdecl boost::python::converter::registry::query(struct boost::python::type_info)" (__imp_?query#registry#converter#python#boost##YAPBUregistration#234#Utype_info#34##Z)
until the installation exits with error
build\lib.win32-3.6\pyublas\_internal.cp36-win32.pyd : fatal error LNK1120: 22 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x86\\link.exe' failed with exit status 1120
You could try to install this package manually:
Clone source code;
Open setup.py and remove python logic which adds this flag. (in my version they are lines 16, and 17:
StringListOption("CXXFLAGS", ["-Wno-sign-compare"],
help="Any extra C++ compiler options to include"),
Use python setup.py install to install the package with changed setup.py
Hope this will help you.
conda install pyublas
You need to install anaconda/miniconda from
https://conda.io/docs/user-guide/install/index.html

Categories

Resources