Python 3 pyOpenGL install problems - python

So I'm attempting to install pyOpenGL to work on some projects and gain a deeper understanding of python stuff..But I'm coming into contact with the error I posted here. To me it seems like a folder hierarchy issue but I suck at fixing those. I tried updating setuptools and installing the openGL context separate but to no avail...I have Python 3 downloaded directly into my c: drive because my python 2.7 was in appdata and was annoying to work with...But now I'm thinking my pip install is referring to that because it looks like that in my error..
But..I have no clue..
Any help would be appreciated thanks.
Complete output from command c:\python3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\KODY~1.DES\AppData\Local\Temp\pip-build-do61jv87\pyOpenGL-accelerate\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\KODY~1.DES\AppData\Local\Temp\pip-sgf63oun-record\install-record.txt --single-version-externally-managed --compile:
Unable to import numpy, skipping numpy extension building
running install
running build
running build_py
creating build
creating build\lib.win32-3.5
creating build\lib.win32-3.5\OpenGL_accelerate
copying .\setup.py -> build\lib.win32-3.5\OpenGL_accelerate
copying .__init__.py -> build\lib.win32-3.5\OpenGL_accelerate
running build_ext
building 'OpenGL_accelerate.wrapper' extension
creating build\temp.win32-3.5
creating build\temp.win32-3.5\Release
creating build\temp.win32-3.5\Release\src
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\KODY~1.DES\AppData\Local\Temp\pip-build-do61jv87\pyOpenGL-accelerate.. -IC:\Users\KODY~1.DES\AppData\Local\Temp\pip-build-do61jv87\pyOpenGL-accelerate\src -IC:\Users\KODY~1.DES\AppData\Local\Temp\pip-build-do61jv87\pyOpenGL-accelerate -Ic:\python3\include -Ic:\python3\include /Tcsrc\wrapper.c /Fobuild\temp.win32-3.5\Release\src\wrapper.obj
error: command 'cl.exe' failed: No such file or directory
----------------------------------------
Command "c:\python3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\KODY~1.DES\AppData\Local\Temp\pip-build-do61jv87\pyOpenGL-accelerate\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\KODY~1.DES\AppData\Local\Temp\pip-sgf63oun-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\KODY~1.DES\AppData\Local\Temp\pip-build-do61jv87\pyOpenGL-accelerate\

I had the same issue make sure you have the latest version of Microsoft Visual C++ before installing PyOpenGL_accelerate
https://visualstudio.microsoft.com/downloads/

Related

ERROR: Command errored out with exit status 1 while installing pyaudio

After doing pip install pyaudio, It started collecting the package but suddenly it displayed this error. Hope the following explains what's going on:
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\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\mayank\AppData\Local\Temp\pip-record-s8qn1fa4\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\Include\pyaudio'
cwd: C:\Users\mayank\AppData\Local\Temp\pip-install-b1kw0ltr\pyaudio\
Complete output (15 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
copying src\pyaudio.py -> build\lib.win32-3.8
running build_ext
building '_portaudio' extension
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\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\mayank\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\mayank\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.8\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\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-b1kw0ltr\\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\mayank\AppData\Local\Temp\pip-record-s8qn1fa4\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\Include\pyaudio' Check the logs for full command output.
brew install portaudio
Then:
brew link portaudio
pip install pyAudio
Or if you are using windows:
Go to: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
Download the file and then go to its directory in the cmd and type:
For win 32 bit:
pip install PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl
For win 64 bit:
pip install PyAudio‑0.2.11‑cp38‑cp38‑win_amd64.whl
For windows-
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
press ctrl + f and search pyaudio and scroll down
Download any version of this if you are using 64 bit-
PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl
or download any version of this if you are using 32 bit -
PyAudio‑0.2.11‑cp39‑cp39‑win32.whl
go to the file location of the downloaded file and press Shift + Right click
select open command window here
then copy the file name and paste like pip install "file name" for e.g-
pip install PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl
If you are working on Ubunutu/Linux try below.
It worked for me
sudo apt-get install portaudio19-dev
pip install pyaudio
You have to download the pyAudio file manually and put it in a directory and cd to the same directory and run the given command.
I had the same issue and fixed it using pipwin:
pip install pipwin
pipwin install pyaudio

pip install PyAudio: error: command 'cl.exe' failed: No such file or directory [duplicate]

This question already has answers here:
python pip on Windows - command 'cl.exe' failed
(9 answers)
Closed 3 years ago.
I am trying to install PyAudio on windows 10 but i am getting the following error. first it has given the error to install Microsoft Visual C++ Build Tools so i installed successfully. But now it showing following. Thanks
ERROR: Command errored out with exit status 1:
command: 'c:\users\nadeem\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NADEEM\\AppData\\Local\\Temp\\pip-install-g79_tntp\\PyAudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\NADEEM\\AppData\\Local\\Temp\\pip-install-g79_tntp\\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\NADEEM\AppData\Local\Temp\pip-record-_8egf72w\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\NADEEM\AppData\Local\Temp\pip-install-g79_tntp\PyAudio\
Complete output (13 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
copying src\pyaudio.py -> build\lib.win32-3.8
running build_ext
building '_portaudio' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\src
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\nadeem\appdata\local\programs\python\python38-32\include -Ic:\users\nadeem\appdata\local\programs\python\python38-32\include /Tcsrc/_portaudiomodule.c /Fobuild\temp.win32-3.8\Release\src/_portaudiomodule.obj
error: command 'cl.exe' failed: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\nadeem\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NADEEM\\AppData\\Local\\Temp\\pip-install-g79_tntp\\PyAudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\NADEEM\\AppData\\Local\\Temp\\pip-install-g79_tntp\\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\NADEEM\AppData\Local\Temp\pip-record-_8egf72w\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
The pip install is trying to download and compile the library. Getting the Windows compilers are easier now, but can be a pain. https://wiki.python.org/moin/WindowsCompilers
Years ago when the compilers were a true pain to get Christoph Gohlke compiled and distributed the libraries for windows.
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
Download the .whl file for your python version and tell pip to install that file.
pip install ~/Downloads/PyAudio‑0.2.11‑cp36‑cp36m‑win_amd64.whl

PIP | Can't install screen

When I try to install screen by entering python -m pip install screen I get this error:
$ python -m pip install screen
Collecting screen
Using cached https://files.pythonhosted.org/packages/a4/d2/68dacd66f28618462650e475f29663eb1f97cecdc3cf8f0881e52f425a3a/screen-1.0.1.tar.gz
Building wheels for collected packages: screen
Running setup.py bdist_wheel for screen: started
Running setup.py bdist_wheel for screen: finished with status 'error'
Complete output from command C:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\MrGrimod\\AppData\\Local\\Temp\\pip-install-z29mr6h3\\screen\\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\MrGrimod\AppData\Local\Temp\pip-wheel-ia8iysps --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\screen
copying screen\compat.py -> build\lib.win-amd64-3.6\screen
copying screen\old_str_util.py -> build\lib.win-amd64-3.6\screen
copying screen\__init__.py -> build\lib.win-amd64-3.6\screen
running build_ext
building 'screen.str_util' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\source
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\include -IC:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\Include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /Tcsource/str_util.c /Fobuild\temp.win-amd64-3.6\Release\source/str_util.obj
str_util.c
c:\users\mrgrimod\appdata\local\programs\python\python36\include\pyconfig.h(59): fatal error C1083: Datei (Include) kann nicht ge▒ffnet werden: "io.h": No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX64\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for screen
Running setup.py clean for screen
Failed to build screen
Installing collected packages: screen
Running setup.py install for screen: started
Running setup.py install for screen: finished with status 'error'
Complete output from command C:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\MrGrimod\\AppData\\Local\\Temp\\pip-install-z29mr6h3\\screen\\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\MrGrimod\AppData\Local\Temp\pip-record-exrcd0r5\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\screen
copying screen\compat.py -> build\lib.win-amd64-3.6\screen
copying screen\old_str_util.py -> build\lib.win-amd64-3.6\screen
copying screen\__init__.py -> build\lib.win-amd64-3.6\screen
running build_ext
building 'screen.str_util' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\source
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\include -IC:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\Include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /Tcsource/str_util.c /Fobuild\temp.win-amd64-3.6\Release\source/str_util.obj
str_util.c
c:\users\mrgrimod\appdata\local\programs\python\python36\include\pyconfig.h(59): fatal error C1083: Datei (Include) kann nicht ge▒ffnet werden: "io.h": No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX64\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Users\MrGrimod\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\MrGrimod\\AppData\\Local\\Temp\\pip-install-z29mr6h3\\screen\\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\MrGrimod\AppData\Local\Temp\pip-record-exrcd0r5\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\MrGrimod\AppData\Local\Temp\pip-install-z29mr6h3\screen\
I already installed setuptool successfully, but the error is still there.
most of the time, these kind of issues occurs due to c++ building tools are missing in your environment. download the tools from Microsoft and install.
Although I didn't manage to solve this specific problem I solved it for me by using Pillow GrabScreen instead of screen! Works like a charm

Could not install pycocotools in windows: fatal error C1083: Cannot open include file: 'io.h': No such file or directory error:

I'm new to machine learning and have started with a windows 8.1 pc having GeForce GTX 540M. I followed this tutorial to get started with the object detection models. I built my own dataset and tried to train it as per the tutorial but with "ssd_mobilenet_v1_coco_2017_11_17" model. But could not perform it successfully as i had troubles with the "train.py" file given in the tutorial.
So I googled and found that we have to use "model_main.py" to train the model. While trying to train using "model_main.py" I got this error:
"ImportModuleError: No module named 'pycocotools' was found"
So I tried to install the cocoapi from this link . I followed the instructions as given, but got stuck with the error shown below, I've tried a lot of solutions but nothing worked. Any help will be much appreciated.
(tensorflow1) C:\tensorflow1\models\research\object_detection>pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
Collecting git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
Cloning https://github.com/philferriere/cocoapi.git to c:\users\home\appdata\l
ocal\temp\pip-req-build-76t4e6ys
Building wheels for collected packages: pycocotools
Running setup.py bdist_wheel for pycocotools ... error
Complete output from command c:\users\home\anaconda3\envs\tensorflow1\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Home\\AppData\\Local\\Temp\\pip-req-build-76t4e6ys\\PythonAPI\\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\Home\AppData\Local\Temp\pip-wheel-4_r37hm6 --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.6\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.6\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.6\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.6\pycocotools
running build_ext
building 'pycocotools._mask' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\pycocotools
creating build\temp.win-amd64-3.6\common
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c/nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\home\anaconda3\envs\tensorflow1\lib\site-packages\numpy\core\include -I../common -Ic:\users\home\anaconda3\envs\tensorflow1\include -Ic:\users\home\anaconda3\envs\tensorflow1\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include" /Tcpycocotools/_mask.c /Fobuild\temp.win-amd64-3.6\Release\pycocotools/_mask.obj
_mask.c
c:\users\home\anaconda3\envs\tensorflow1\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for pycocotools
Running setup.py clean for pycocotools
Complete output from command c:\users\home\anaconda3\envs\tensorflow1\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Home\\AppData\\Local\\Temp\\pip-req-build-76t4e6ys\\PythonAPI\\setup.py';f=getattr(tokenize, 'open',open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Home\AppData\Local\Temp\pip-req-build-76t4e6ys\PythonAPI\setup.py", line 25, in <module>
cythonize(ext_modules)
File "c:\users\home\anaconda3\envs\tensorflow1\lib\site-packages\Cython\Build\Dependencies.py", line 956, in cythonize
aliases=aliases)
File "c:\users\home\anaconda3\envs\tensorflow1\lib\site-packages\Cython\Buil
d\Dependencies.py", line 801, in create_extension_list
for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't ma
tch any files" % filepattern):
File "c:\users\home\anaconda3\envs\tensorflow1\lib\site-packages\Cython\Buil
d\Dependencies.py", line 111, in nonempty
raise ValueError(error_msg)
ValueError: 'pycocotools/_mask.pyx' doesn't match any files
----------------------------------------
Failed cleaning build dir for pycocotools
Failed to build pycocotools
Installing collected packages: pycocotools
Running setup.py install for pycocotools ... error
Complete output from command c:\users\home\anaconda3\envs\tensorflow1\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Home\\AppData\\Local\\Temp\\pip-req-build-76t4e6ys\\PythonAPI\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext "-L/C:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/ucrt" install --record C:\Users\Home\AppData\Local\Temp\pip-record-ykypadav\install-record.txt --single-version-externally-managed --compile:
running build_ext
building 'pycocotools._mask' extension
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c/nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\home\anaconda3\envs\tensorflow1\lib\site-packages\numpy\core\include -I../common -Ic:\users\home\anaconda3\envs\tensorflow1\include -Ic:\users\home\anaconda3\envs\tensorflow1\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include" /Tcpycocotools/_mask.c /Fobuild\temp.win-amd64-3.6\Release\pycocotools/_mask.obj
_mask.c
c:\users\home\anaconda3\envs\tensorflow1\include\pyconfig.h(59): fatal error
C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit
status 2
----------------------------------------
Command "c:\users\home\anaconda3\envs\tensorflow1\python.exe -u -c "import setup
tools, tokenize;__file__='C:\\Users\\Home\\AppData\\Local\\Temp\\pip-req-build-76t4e6ys\\PythonAPI\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext "-L/C:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/ucrt" install --record C:\Users\Home\AppData\Local\Temp\pip-record-ykypadav\install-record.txt --single-version-externally-managed --compile" failed with error code 1
in C:\Users\Home\AppData\Local\Temp\pip-req-build-76t4e6ys\PythonAPI
(tensorflow1) C:\tensorflow1\models\research\object_detection>
easy fix, use pip install pycocotools-windows
First install Visual C++ 2015 Build Tools from https://go.microsoft.com/fwlink/?LinkId=691126 with default selection.
Then,
pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI
you can try:
pip install pycocotools-windows
it's worked for me :) on windows station :
I was getting the same error
ValueError: 'pycocotools/_mask.pyx' doesn't match any files
So I cloned https://github.com/waleedka/coco to my local device. Then when I was running make I was getting the above error.
the exact command I was running was--
C:\Users\Admin\Desktop\coco-master>python3 PythonAPI/setup.py build_ext install
I was when I was running above command I got the problem.
Then I found out a solution on the issues page of the same repository. It happens that you have to cd into PythonAPI then run--
python setup.py build_ext --inplace
That solved some problems for me.
Moreover some people were saying they still got problems but when they used python3 instead of python their problem was solved.
Try the following command (it worked for me on Windows 10, Python 3.7.5, and Visual 2017) :
pip3 install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
(from https://github.com/cocodataset/cocoapi/issues/169#issuecomment-462528628)
If you are getting this ERROR: Command errored out with exit status 1 or 2
Then install this:
pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^subdirectory=PythonAPI
pip install pycocotools-windows
worked for me

Failed to install zbar with pip on Windows

I'm trying to install zbar on my Windows x64 machine:
pip install zbar
And this is what I got:
Collecting zbar
Using cached zbar-0.10.tar.bz2
Installing collected packages: zbar
Running setup.py install for zbar ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\ruiyang\\appdata\\local\\temp\\pip-build-t2okcg\\zbar\\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\ruiyang\appdata\local\temp\pip-4pohzw-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'zbar' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
C:\Users\Ruiyang\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:\Python27\PC /Tczbarmodule.c /Fobuild\temp.win-amd64-2.7\Release\zbarmodule.obj
zbarmodule.c
c:\users\ruiyang\appdata\local\temp\pip-build-t2okcg\zbar\zbarmodule.h(26) : fatal error C1083: Cannot open include file: 'zbar.h': No such file or directory
error: command 'C:\\Users\\Ruiyang\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\ruiyang\\appdata\\local\\temp\\pip-build-t2okcg\\zbar\\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\ruiyang\appdata\local\temp\pip-4pohzw-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\ruiyang\appdata\local\temp\pip-build-t2okcg\zbar\
Anyone knows how to fix this problem?
You are trying to install zbar package with pip. When doing so, pip downloads the source and tries to compile the C/C++ source code of this project.
To do such a thing, you need a C/C++ compiler and having all dependencies. It may be complicated to have pip compiles this package.
The other solution is to download a binary wheel that embeds all binaries. zbar developers propose to download a binary wheel from their GitHub webpage
You can download this binary wheel, that targets a Windows Python 2.7 64 bit installation.
All you have to do is:
open a Windows cli with Windows+R and by running inside cmd
go to the directory where you have downloaded the whl file, with cd instructions
run pip install zbar-0.10-cp27-none-win_amd64.whl
For example, the command can be
pip install zbar-0.10-cp27-none-win_amd64.whl
If you have several Python installations, make sure to use the correct pip program.
You can do it for any package with some code that has to be compiled

Categories

Resources