Im getting below error when installing PyGObject using pip on windows python version 2.7.18
pip install PyGObject
ERROR: Command errored out with exit status 1:
command: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\test\appdata\local\temp\pip-build-env-9
qeux4\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo
cwd: None
Complete output (35 lines):
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support
for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting setuptools
Using cached setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
Collecting wheel
Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
Collecting pycairo
Using cached pycairo-1.18.2.tar.gz (200 kB)
Using legacy 'setup.py install' for pycairo, since package 'wheel' is not installed.
Installing collected packages: setuptools, wheel, pycairo
Running setup.py install for pycairo: started
Running setup.py install for pycairo: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\test\\appdata\\local\\temp\\pip-install-cp90gz\\pycairo\
\setup.py'"'"'; __file__='"'"'c:\\users\\test\\appdata\\local\\temp\\pip-install-cp90gz\\pycairo\\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\test\appdata\local\temp\pip-record-n
nbplv\install-record.txt' --single-version-externally-managed --prefix 'c:\users\test\appdata\local\temp\pip-build-env-9qeux4\overlay' --compile --install-headers 'c:\u
sers\test\appdata\local\temp\pip-build-env-9qeux4\overlay\Include\pycairo'
cwd: c:\users\test\appdata\local\temp\pip-install-cp90gz\pycairo\
Complete output (18 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\cairo
copying cairo\__init__.py -> build\lib.win-amd64-2.7\cairo
copying cairo\__init__.pyi -> build\lib.win-amd64-2.7\cairo
copying cairo\py.typed -> build\lib.win-amd64-2.7\cairo
running build_ext
building 'cairo._cairo' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\cairo
C:\Users\test\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DPYCAIRO_VERSION_MAJOR=1
-DPYCAIRO_VERSION_MINOR=18 -DPYCAIRO_VERSION_MICRO=2 -Ic:\python27\include -Ic:\python27\PC /Tccairo/device.c /Fobuild\temp.win-amd64-2.7\Release\cairo/device.obj
device.c
c:\users\test\appdata\local\temp\pip-install-cp90gz\pycairo\cairo\pycairo.h(37) : fatal error C1083: Cannot open include file: 'cairo.h': No such file or director
y
error: command 'C:\\Users\\test\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\test\\appdata\\local\\t
emp\\pip-install-cp90gz\\pycairo\\setup.py'"'"'; __file__='"'"'c:\\users\\test\\appdata\\local\\temp\\pip-install-cp90gz\\pycairo\\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\tes
t\appdata\local\temp\pip-record-nnbplv\install-record.txt' --single-version-externally-managed --prefix 'c:\users\test\appdata\local\temp\pip-build-env-9qeux4\overlay'
--compile --install-headers 'c:\users\test\appdata\local\temp\pip-build-env-9qeux4\overlay\Include\pycairo' Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users\test
\appdata\local\temp\pip-build-env-9qeux4\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simplehttps://pypi.org/simple -- setuptools wheel pycai
ro Check the logs for full command output.
You won't be able to install PyGObject like that because MS Visual C is not going to be able to compile it.
If you follow the PyGObject Getting Started in Windows instructions, you should be able to install PyGObject in Windows using MSYS2.
Go to http://www.msys2.org/ and download the x86_64 installer
Follow the instructions on the page for setting up the basic environment
Run C:\msys64\mingw64.exe - a terminal window should pop up
Execute pacman -Suy
Execute pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-gobject
To test that GTK 3 is working you can run gtk3-demo
Copy the hello.py script you created to C:\msys64\home\<username>
In the mingw64 terminal execute python3 hello.py - a window should appear.
Related
C:\Users\Dell\PycharmProjects\pythonProject1>pip install pyaudio
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-qm5dhs1u\\pyaud
io_0fa5615a0f1d45fe897d47e2b712cf51\\setup.py'"'"'; __file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-qm5dhs1u\\pyaudio_0fa5615a0f1d45fe897d47e2b712cf
51\\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-mst52wx_\install-record.txt' --single-version-externally-managed --compile --install-head
ers 'c:\python37\Include\pyaudio'
cwd: C:\Users\Dell\AppData\Local\Temp\pip-install-qm5dhs1u\pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Local\\
Temp\\pip-install-qm5dhs1u\\pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\\setup.py'"'"'; __file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-qm5dhs1u\\pyaud
io_0fa5615a0f1d45fe897d47e2b712cf51\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python37\python.exe' -u -c 'im
port sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Loca
l\\Temp\\pip-install-qm5dhs1u\\pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\\setup.py
'"'"'; __file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-qm5dhs1u\
\pyaudio_0fa5615a0f1d45fe897d47e2b712cf51\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.cl
ose();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Dell\AppData\Local\Temp\pip-record-mst52wx_\install-record.txt' --single-version-exte
rnally-managed --compile --install-headers 'c:\python37\Include\pyaudio' Check the logs for full command output.
you need to follow these two steps in order to install pyaudio:-
pip install pipwin
pipwin install pyaudio
I hope this resolves your problem.
As the error message says, please install the build tools:
Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
I made a program that solves this for you. I will put the code in here. It uses the os.system function to do the CMD stuff for you, just an easier way to download it.
import os
os.system('cmd /k "pip install pipwin"')
os.system('cmd /k "pipwin install PyAudio"')
Then run that and it will do it all for you, if it doesn't work on the first try, just run it again. Sometimes it has to restart CMD for pipwin to start working
when i run the command ;
pip3 install --user --upgrade gnuhealth-client
it shows the same error msg everytime
gnuhealth#ghealth:~ $ pip3 install --user --upgrade gnuhealth-client
Collecting gnuhealth-client
Using cached gnuhealth-client-3.6.9.tar.gz (700 kB)
Collecting pycairo
Using cached pycairo-1.19.1.tar.gz (205 kB)
Requirement already satisfied, skipping upgrade: python-dateutil in ./.local/lib/python3.6/site-packages (from gnuhealth-client) (2.8.1)
Collecting PyGObject
Using cached PyGObject-3.36.1.tar.gz (716 kB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/gnuhealth/.local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-w04za2un/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo
cwd: None
Complete output (31 lines):
Collecting setuptools
Using cached setuptools-49.6.0-py3-none-any.whl (803 kB)
Collecting wheel
Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
Collecting pycairo
Using cached pycairo-1.19.1.tar.gz (205 kB)
Using legacy 'setup.py install' for pycairo, since package 'wheel' is not installed.
Installing collected packages: setuptools, wheel, pycairo
Running setup.py install for pycairo: started
Running setup.py install for pycairo: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ax6ip1o2/pycairo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ax6ip1o2/pycairo/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-2p1yavr2/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-w04za2un/overlay --compile --install-headers /tmp/pip-build-env-w04za2un/overlay/include/python3.6m/pycairo
cwd: /tmp/pip-install-ax6ip1o2/pycairo/
Complete output (15 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/cairo
copying cairo/__init__.py -> build/lib.linux-x86_64-3.6/cairo
copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.6/cairo
copying cairo/py.typed -> build/lib.linux-x86_64-3.6/cairo
running build_ext
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ax6ip1o2/pycairo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ax6ip1o2/pycairo/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-2p1yavr2/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-w04za2un/overlay --compile --install-headers /tmp/pip-build-env-w04za2un/overlay/include/python3.6m/pycairo Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /home/gnuhealth/.local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-w04za2un/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo Check the logs for full command output.
what should i do ?
UPDATED ANSWER
It's PyGObject that is failing
try
sudo yum install gcc gobject-introspection-devel cairo-devel pkg-config python3-devel gtk3 cairo-gobject-devel
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig
before attempting the pip install
This actually worked for me on Centos7
This question already has answers here:
How to fix installation issues for PyAudio, PortAudio: "fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory"
(10 answers)
Closed 2 years ago.
hello i am trying to install the modul PyAudio and when i am using
pip install pyaudo it respond
pip install pyaudio
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: pyaudio
Building wheel for pyaudio (setup.py): started
Building wheel for pyaudio (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'c:\users\hugol\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hugol\\AppData\\Local\\Temp\\pip-install-jkmuij1i\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\hugol\\AppData\\Local\\Temp\\pip-install-jkmuij1i\\pyaudio\\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\hugol\AppData\Local\Temp\pip-wheel-o1wkrc23'
cwd: C:\Users\hugol\AppData\Local\Temp\pip-install-jkmuij1i\pyaudio\
Complete output (9 lines):
running bdist_wheel
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
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Failed building wheel for pyaudio
Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio: started
Running setup.py install for pyaudio: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'c:\users\hugol\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hugol\\AppData\\Local\\Temp\\pip-install-jkmuij1i\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\hugol\\AppData\\Local\\Temp\\pip-install-jkmuij1i\\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\hugol\AppData\Local\Temp\pip-record-iikxybis\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\hugol\appdata\local\programs\python\python38-32\Include\pyaudio'
cwd: C:\Users\hugol\AppData\Local\Temp\pip-install-jkmuij1i\pyaudio\
Complete output (9 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
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\hugol\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hugol\\AppData\\Local\\Temp\\pip-install-jkmuij1i\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\hugol\\AppData\\Local\\Temp\\pip-install-jkmuij1i\\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\hugol\AppData\Local\Temp\pip-record-iikxybis\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\hugol\appdata\local\programs\python\python38-32\Include\pyaudio' Check the logs for full command output.
and i dont know ho to fix this problem
First, try to run this as admin on your CMD:
pip install pipwin
pipwin install pyaudio
Second, if the problem doesn't resolve, try to install the setuptools:
pip install --upgrade setuptools
Third, you may have to install Visual C++
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
I keep getting this while trying to install PyGObject for Python 3.7 in Pycharm. I at first got the error where cl.exe couldn't be found, but I did some research and would that apparently C++ toolkit was missing even though I could locate cl.exe. I reinstalled pip, toolkit, and added cl.exe to PATH, and this new error came up:
ERROR: Command errored out with exit status 1
Command:
Collecting PyGObject
Using cached PyGObject-3.36.0.tar.gz (714 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\Scripts\python.exe'
'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\lib\site-packages\pip' install --
ignore-installed --no-user --prefix 'C:\Users\Latitude\AppData\Local\Temp\pip-build-env-
gv8msoqy\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i
https://pypi.org/simple -- setuptools wheel pycairo
cwd: None
Complete output (35 lines):
Collecting setuptools
Using cached setuptools-46.1.3-py3-none-any.whl (582 kB)
Collecting wheel
Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Collecting pycairo
Using cached pycairo-1.19.1.tar.gz (205 kB)
Installing collected packages: setuptools, wheel, pycairo
Running setup.py install for pycairo: started
Running setup.py install for pycairo: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\Scripts\python.exe' -u -
c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Latitude\\AppData\\Local\\Temp\\pip-install-i870hprp\\pycairo\\setup.py'"'"'; __file__='"'"'C:\\Users\\Latitude\\AppData\\Local\\Temp\\pip-install-i870hprp\\pycairo\\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\Latitude\AppData\Local\Temp\pip-record-si_3ert2\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\Latitude\AppData\Local\Temp\pip-build-env-gv8msoqy\overlay' --compile --install-headers 'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\include\site\python3.7\pycairo'
cwd: C:\Users\Latitude\AppData\Local\Temp\pip-install-i870hprp\pycairo\
Complete output (20 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\cairo
copying cairo\__init__.py -> build\lib.win-amd64-3.7\cairo
copying cairo\__init__.pyi -> build\lib.win-amd64-3.7\cairo
copying cairo\py.typed -> build\lib.win-amd64-3.7\cairo
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'cairo._cairo' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\cairo
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL
/DNDEBUG /MT -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_MINOR=19 -DPYCAIRO_VERSION_MICRO=1 -
IC:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\include -IC:\Users\Latitude\AppData\Local\Programs\Python\Python37\include -IC:\Users\Latitude\AppData\Local\Programs\Python\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-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" /Tccairo/device.c /Fobuild\temp.win-amd64-3.7\Release\cairo/device.obj
device.c
C:\Users\Latitude\AppData\Local\Temp\pip-install-i870hprp\pycairo\cairo\pycairo.h(37): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Latitude\\AppData\\Local\\Temp\\pip-install-i870hprp\\pycairo\\setup.py'"'"'; __file__='"'"'C:\\Users\\Latitude\\AppData\\Local\\Temp\\pip-install-i870hprp\\pycairo\\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\Latitude\AppData\Local\Temp\pip-record-si_3ert2\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\Latitude\AppData\Local\Temp\pip-build-env-gv8msoqy\overlay' --compile --install-headers 'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\include\site\python3.7\pycairo' Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1:
'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\Scripts\python.exe'
'C:\Users\Latitude\PycharmProjects\ESC190\project_scheduler\venv\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Latitude\AppData\Local\Temp\pip-build-env-gv8msoqy\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel pycairo Check the logs for full command output.
I was getting same error while installing pywhatkit. I used pip install --upgrade pip setuptools wheel --user first then installed pywhatkit using command pip install pywhatkit and it worked.
delete windows temp files and add this argument to the end of the install command --no-cache-dir
if it didn't work try to install tokenize module first