error installing glove-python : 'cl.exe' failed with exit status 2 - windows-10

I am trying to install glove-python package on python3.5 (x64) and I got errors as it is shown below.
Note that I have TDM-GCC-64, MinGW32, MinGW64 ,Cygwin, microsot visual c++ for python 2.7 , microsoft visual 2008 (x64) and microsoft visual c++ 2015 (x64) Redistributable installed on my windows 10 to try to solve the problem.
I tried many solutions like creating distutils.cfg file to build package using mingw32/cygwin/mingw64 but all my trials gave me different errors! so I deleted the distutils.cfg file at all , But also this gives me an error as it is shown below .
Note: the path written in the error is for microsoft visual c++ for python 2.7 (but I am using python35) so this may be the cause of the error ?
Also I feel that the error may be due to Cython not running . I installed Cython 0.25.2 using pip install .But when I run pycharm debugger it gives me a warning that debugger speedups using cython not found.Also I got errors (during my trials to install the package by different ways) when building "glove.glove_cython".
Here is the error :
C:\Users\ESCA>pip3 install glove-python
Collecting glove-python
Using cached glove_python-0.1.0.tar.gz
Requirement already satisfied: numpy in c:\users\esca\appdata\local\programs\python\python35\lib\site-packages (from glove-python)
Requirement already satisfied: scipy in c:\users\esca\appdata\local\programs\python\python35\lib\site-packages (from glove-python)
Building wheels for collected packages: glove-python
Running setup.py bdist_wheel for glove-python ... error
Complete output from command c:\users\esca\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ESCA\\AppData\\Local\\Temp\\pip-build-4tm726dc\\glove-python\\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\ESCA\AppData\Local\Temp\tmp0war2fdwpip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\glove
copying glove\corpus.py -> build\lib.win-amd64-3.5\glove
copying glove\glove.py -> build\lib.win-amd64-3.5\glove
copying glove\__init__.py -> build\lib.win-amd64-3.5\glove
running build_ext
building 'glove.glove_cython' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\glove
C:\Users\ESCA\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\users\esca\appdata\local\programs\python\python35\include -Ic:\users\esca\appdata\local\programs\python\python35\include /Tcglove/glove_cython.c /Fobuild\temp.win-amd64-3.5\Release\glove/glove_cython.obj -fopenmp -ffast-math -march=native
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
cl : Command line warning D9002 : ignoring unknown option '-ffast-math'
cl : Command line warning D9002 : ignoring unknown option '-march=native'
glove_cython.c
c:\users\esca\appdata\local\programs\python\python35\include\pyconfig.h(68) : fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Users\\ESCA\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\bin\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for glove-python
Running setup.py clean for glove-python
Complete output from command c:\users\esca\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ESCA\\AppData\\Local\\Temp\\pip-build-4tm726dc\\glove-python\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --all not recognized
----------------------------------------
Failed cleaning build dir for glove-python
Failed to build glove-python
Installing collected packages: glove-python
Running setup.py install for glove-python ... error
Complete output from command c:\users\esca\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ESCA\\AppData\\Local\\Temp\\pip-build-4tm726dc\\glove-python\\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\ESCA\AppData\Local\Temp\pip-gs05_i6s-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running build_ext
building 'glove.glove_cython' extension
C:\Users\ESCA\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\users\esca\appdata\local\programs\python\python35\include -Ic:\users\esca\appdata\local\programs\python\python35\include /Tcglove/glove_cython.c /Fobuild\temp.win-amd64-3.5\Release\glove/glove_cython.obj -fopenmp -ffast-math -march=native
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
cl : Command line warning D9002 : ignoring unknown option '-ffast-math'
cl : Command line warning D9002 : ignoring unknown option '-march=native'
glove_cython.c
c:\users\esca\appdata\local\programs\python\python35\include\pyconfig.h(68) : fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Users\\ESCA\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\users\esca\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ESCA\\AppData\\Local\\Temp\\pip-build-4tm726dc\\glove-python\\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\ESCA\AppData\Local\Temp\pip-gs05_i6s-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ESCA\AppData\Local\Temp\pip-build-4tm726dc\glove-python\

Try out this setup.py instead when you're compiling, works on the default install directories in Windows x64 machines:
from Cython.Distutils import build_ext
import numpy as np
import os
try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
module = 'mymodule'
ext_modules = [Extension(module, sources=[module + '.pyx'],
include_dirs=['C://Program Files (x86)//Windows Kits//10//Include//10.0.10240.0//ucrt','C://Program Files (x86)//Microsoft Visual Studio 14.0//VC//include','C://Program Files (x86)//Windows Kits//8.1//Include//shared'],
library_dirs=['C://Program Files (x86)//Windows Kits//8.1//bin//x64', 'C://Windows//System32', 'C://Program Files (x86)//Microsoft Visual Studio 14.0//VC//lib//amd64', 'C://Program Files (x86)//Windows Kits//8.1//Lib//winv6.3//um//x64', 'C://Program Files (x86)//Windows Kits//10//Lib//10.0.10240.0//ucrt//x64'],
extra_compile_args=['/Ot', '/favor:INTEL64', '/EHsc', '/GA', '/openmp'],
language='c++')]
setup(
name = module,
ext_modules = ext_modules,
cmdclass = {'build_ext': build_ext},
include_dirs = [np.get_include(), os.path.join(np.get_include(), 'numpy')]
)
Note the above may need some serious editing for your paths to each include directory, as well as for the package you're installing. You're better off with Python 3.5 on Windows x64 to install Visual Studio 2015 Community then doing the python setup.py install from a VS command prompt that sets up all the include directories for you, either the VS2015 x64 native tools or MSBuild command prompt for VS2015 which appear after installing Community. Note that the VS2015 versions require Community at least to build Python modules as they got rid of the prior ability to compile via Microsoft redistributables.

Related

fatal error: openjpeg.h: No such file or directory

I'm trying to install OpenCV4 on Debian 10 server. I followed the official docs , but compiling I get
In file included from /root/opencv/modules/imgcodecs/src/grfmt_jpeg2000_openjpeg.cpp:10:
/root/opencv/modules/imgcodecs/src/grfmt_jpeg2000_openjpeg.hpp:13:10: fatal error: openjpeg.h: No such file or directory
#include <openjpeg.h>
^~~~~~~~~~~~
compilation terminated.
I installed openjpeg separately from source (this guide)
But it did not help.
I also tried to install opencv4 using pip3 install opencv-python but again, I failed:
An error occurred while building with CMake.
Command:
cmake --build . --target install --config Release --
Install target:
install
Source directory:
/tmp/pip-install-58cut84q/cmake
Working directory:
/tmp/pip-install-58cut84q/cmake/_skbuild/linux-x86_64-3.7/cmake-build
Please check the install target is valid and see CMake's output for more information.
---------------------------------------- Command "/usr/bin/python3 -u -c "import setuptools,
tokenize;file='/tmp/pip-install-58cut84q/cmake/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, file, 'exec'))" install
--record /tmp/pip-record-wvupk349/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-uyj03w3k --compile" failed with error code 1 in
/tmp/pip-install-58cut84q/cmake/
So I'm left clueless and appreciate your help.

python module nmap could not be installed

A python novice here. I am trying to use python nmap library. In order to install that I use following command that is failing with error shown below as well.
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64>pip install python-nmap
Collecting python-nmap
Using cached https://files.pythonhosted.org/packages/dc/f2/9e1a2953d4d824e183ac033e3d223055e40e695fa6db2cb3e94a864eaa84/python-nmap-0.6.1.tar.gz
Installing collected packages: python-nmap
Running setup.py install for python-nmap ... error
Complete output from command "c:\program files (x86)\microsoft visual studio\shared\python36_64\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\root\\AppData\\Local\\Temp\\pip-install-lsrfn3ac\\python-nmap\\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\root\AppData\Local\Temp\pip-record-t73k4f0r\install-record.txt --single-version-externally-managed --compile:
c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\nmap
copying nmap\nmap.py -> build\lib\nmap
copying nmap\test.py -> build\lib\nmap
copying nmap\test_nmap.py -> build\lib\nmap
copying nmap\__init__.py -> build\lib\nmap
running install_lib
creating c:\program files (x86)\microsoft visual studio\shared\python36_64\Lib\site-packages\nmap
error: could not create 'c:\program files (x86)\microsoft visual studio\shared\python36_64\Lib\site-packages\nmap': Access is denied
----------------------------------------
Command ""c:\program files (x86)\microsoft visual studio\shared\python36_64\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\root\\AppData\\Local\\Temp\\pip-install-lsrfn3ac\\python-nmap\\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\root\AppData\Local\Temp\pip-record-t73k4f0r\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\root\AppData\Local\Temp\pip-install-lsrfn3ac\python-nmap\
Any ideas what I am doing wrong here?
error: could not create 'c:\program files (x86)\microsoft visual studio\shared\python36_64\Lib\site-packages\nmap': Access is denied
This says a new file is not being created so its clearly a owner permissions.just run the terminal as administrator or root and also verify which version of python interpreter loads when typing python in terminal else just use the pip3 instead of pip as this gets the python3 package.

How to install ChainerCV

I am using Win 10. I tried installing ChainerCV through pip. I want to know what can be done to solve this problem. Also what is behind this issue: not having VisualStudio, dependency issues or any other thing. Is having CUDA necessary to run ChainerCV?
P.S I have chainer and other dependencies running properly.
Stack Trace:
copying chainercv\utils\bbox_nms_gpu_post.c -> build\lib.win-amd64-3.5\chainercv\utils\bbox
running build_ext
building 'chainercv.utils.bbox._nms_gpu_post' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
Failed building wheel for chainercv
Running setup.py clean for chainercv
Failed to build chainercv
Installing collected packages: chainercv
Running setup.py install for chainercv ... error
Complete output from command c:\users\dell\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\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\Dell\AppData\Local\Temp\pip-record-cl7d0zn_\install-record.txt --single-version-externally-managed --compile:
building 'chainercv.utils.bbox._nms_gpu_post' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "c:\users\dell\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\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\Dell\AppData\Local\Temp\pip-record-cl7d0zn_\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\
are you trying on admin ? else please follow below steps
open cmd using Ctrl + r then type cmd and try to install from there
pip install ChainerCV

I get this error while trying to run pip install pyAudio in my pyCharm venv running on windows 10

(venv) C:\Users\Jaymoh\PycharmProjects\Elisanta>pip install PyAudio
Collecting PyAudio Using cached
https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: PyAudio Running setup.py install for
PyAudio ... error
Complete output from command C:\Users\Jaymoh\PycharmProjects\Elisanta\venv\Scripts\python.exe -u -c
"import setuptools,
tokenize;file='C:\Users\Jaymoh\AppData\Local\Temp
\pip-install-sp8mdmpo\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\Jaymoh\AppData\Local\Temp\pip-record-jxykmy44\install-record.txt
--single-version-externally-managed --compile --install-headers C:\Users\Jaymoh\PycharmProjects\Elisa
nta\venv\include\site\python3.7\PyAudio:
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
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\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\cl.exe
/c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Jaymoh\PycharmProje
cts\Elisanta\venv\include
-IC:\Users\Jaymoh\AppData\Local\Programs\Python\Python37-32\include -IC:\Users\Jaymoh\AppData\Local\Programs\Python\Python37-32\include "-IC:\Program Files (x86)\Microsoft Visual
Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include"
"-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(27): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\cl.exe'
failed with exit status 2
---------------------------------------- Command "C:\Users\Jaymoh\PycharmProjects\Elisanta\venv\Scripts\python.exe -u
-c "import setuptools, tokenize;file='C:\Users\Jaymoh\AppData\Local\Temp\pip-install-sp8mdmpo\
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\Jaymoh\A ppData\Local\Temp\pip-record-jxykmy44\install-record.txt
--single-version-externally-managed --compile --install-headers C:\Users\Jaymoh\PycharmProjects\Elisanta\venv\include\site\py
thon3.7\PyAudio" failed with error code 1 in
C:\Users\Jaymoh\AppData\Local\Temp\pip-install-sp8mdmpo\PyAudio\
Simply install pipwin
by pip install pipwin
and the run
pipwin install pyaudio
Download windows 10 sdk from vs buildtools and this should help you.
Download Link:https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017
click on free download

Error while installing pymssql on windows 10

I'm getting "The system cannot find the path specified" error.
Could anyone give me some hint about how to make the path correct?
I've never encountered this type of error before while I'm using pip.
C:\Users\ahkim>pip install pymssql
Collecting pymssql
Downloading pymssql-2.1.3.tar.gz (897kB)
100% |████████████████████████████████| 901kB 1.9MB/s
Building wheels for collected packages: pymssql
Running setup.py bdist_wheel for pymssql ... error
Complete output from command C:\Users\ahkim\AppData\Local\Continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ahkim\\AppData\\Local\\Temp\\pip-build-mfok55b5\\pymssql\\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\ahkim\AppData\Local\Temp\tmp127kpd9epip-wheel- --python-tag cp36:
setup.py: platform.system() => 'Windows'
setup.py: platform.architecture() => ('64bit', 'WindowsPE')
running bdist_wheel
running build
running build_ext
building '_mssql' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
Failed building wheel for pymssql
Running setup.py clean for pymssql
Failed to build pymssql
Installing collected packages: pymssql
Running setup.py install for pymssql ... error
Complete output from command C:\Users\ahkim\AppData\Local\Continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ahkim\\AppData\\Local\\Temp\\pip-build-mfok55b5\\pymssql\\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\ahkim\AppData\Local\Temp\pip-r247wrkl-record\install-record.txt --single-version-externally-managed --compile:
setup.py: platform.system() => 'Windows'
setup.py: platform.architecture() => ('64bit', 'WindowsPE')
running install
running build
running build_ext
cythoning _mssql.pyx to _mssql.c
warning: _mssql.pyx:143:4: Exception already a builtin Cython type
building '_mssql' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
Command "C:\Users\ahkim\AppData\Local\Continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ahkim\\AppData\\Local\\Temp\\pip-build-mfok55b5\\pymssql\\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\ahkim\AppData\Local\Temp\pip-r247wrkl-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ahkim\AppData\Local\Temp\pip-build-mfok55b5\pymssql\
look this https://learn.microsoft.com/en-us/sql/connect/python/pymssql/step-1-configure-development-environment-for-pymssql-python-development
For choose right file to download you must determine number of cp
Ex : cp27 , cp36 and so on
import pip
print(pip.pep425tags.get_supported())
like this :
enter image description here
Person who using Python through anaconda, should run below code in anaconda command line, as admin.
conda install pymssql.
I have testing and worked fine, this will take roughly 20-30 mins while it will also install all other dependencies.

Resources