Errors when installing PyGame in Python - python

I am trying to make a Virtual Assistant and for that i am using PyGame but when i am trying to install PyGame am stuck with this errors, is there any way to get around? I have tried everything but did not succeed
Errors -
Collecting PyAudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Building wheels for collected packages: PyAudio
Building wheel for PyAudio (setup.py): started
Building wheel for PyAudio (setup.py): finished with status 'error'
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: /usr/local/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pycharm-packaging/PyAudio/setup.py'"'"'; __file__='"'"'/private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pycharm-packaging/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 /private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pip-wheel-u4fzx0xa --python-tag cp38
cwd: /private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pycharm-packaging/PyAudio/
Complete output (18 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.8
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.8/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for PyAudio
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pycharm-packaging/PyAudio/setup.py'"'"'; __file__='"'"'/private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pycharm-packaging/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 /private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pip-record-xbb40_p1/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pycharm-packaging/PyAudio/
Complete output (18 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.8
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.8/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pycharm-packaging/PyAudio/setup.py'"'"'; __file__='"'"'/private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pycharm-packaging/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 /private/var/folders/4b/qbpxp4qj1cd8h1m1x1vd59xw0000gn/T/pip-record-xbb40_p1/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Please help me to resolve this errors

It seems like you're missing a dependency called portAudio. Try the following:
brew install portaudio
Brew installation guide in case you don't have it already

Related

I am trying to install pyaudio on Mac and getting the following error

% pip3 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: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-install-yuqomyva/pyaudio_df9e48fd3dc447b18c59302d7aac4fe2/setup.py'"'"'; file='"'"'/private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-install-yuqomyva/pyaudio_df9e48fd3dc447b18c59302d7aac4fe2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-record-kg79q2az/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio
cwd: /private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-install-yuqomyva/pyaudio_df9e48fd3dc447b18c59302d7aac4fe2/
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.9
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.9
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.9
creating build/temp.macosx-10.9-x86_64-3.9/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.9/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-install-yuqomyva/pyaudio_df9e48fd3dc447b18c59302d7aac4fe2/setup.py'"'"'; file='"'"'/private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-install-yuqomyva/pyaudio_df9e48fd3dc447b18c59302d7aac4fe2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-record-kg79q2az/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio Check the logs for full command output.
Try:
pip install pipwin
And:
pipwin install pyaudio
Hope It Helps :D

Can't install pyaudio at python 2.7 on MacOS

I typed: pip install pyaudio
and then it says:
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: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-install-vpovlb7i/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-install-vpovlb7i/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 /private/var/folders/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-record-ek_hs7p1/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyaudio
cwd: /private/var/folders/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-install-vpovlb7i/pyaudio/
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.8
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.8/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-install-vpovlb7i/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-install-vpovlb7i/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 /private/var/folders/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-record-ek_hs7p1/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyaudio Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 20.2 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -m pip install --upgrade pip' command.
This is being installed under python3, So I would recommend you to run this under a virtual environment https://help.dreamhost.com/hc/en-us/articles/215489338-Installing-and-using-virtualenv-with-Python-2 , then try trying this back again while venv being activated

Compile errors installing REGEX in MacOS [duplicate]

This question already has an answer here:
Error on "pip install -U channels" command using for otree (Running setup.py bdist_wheel for twisted ... error)
(1 answer)
Closed 2 years ago.
I'm trying to install Regex on macos catalina, but I'm getting this error, how do I proceed? I tried to update pip, pip3, pipwin, xcode, but both return the same error, the same happens when I install NLTK.
I was able to install on a ubuntu VM and installed everything, REGEX and NLTK, only on MacOs that I continue with this error below:
pip3 install regex
Collecting regex
Using cached regex-2020.6.8.tar.gz (690 kB)
Building wheels for collected packages: regex
Building wheel for regex (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/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 /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-wheel-j6dr4ocd
cwd: /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/regex_3
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.14-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for regex
Running setup.py clean for regex
Failed to build regex
Installing collected packages: regex
Running setup.py install for regex ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-record-olfcxoeu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/regex
cwd: /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/regex_3
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.14-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-record-olfcxoeu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/regex Check the logs for full command output.**strong text**
I am no mac super user but you could try this and check if it works.
xcode-select --install
If it says it's already installed try:
xcode-select --reset
The reason I believe it might be the issue is cause of the xcrun error that is occurring.
The underlying error seems to be:
invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun`
You can most likely solve this by installing the command line tools:
xcode-select --install
See https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a for more details.

Can't install binance package through pip install [duplicate]

This question already has an answer here:
Error on "pip install -U channels" command using for otree (Running setup.py bdist_wheel for twisted ... error)
(1 answer)
Closed 2 years ago.
I am trying to install binance package with pip in my Jupyter notebook by writing pip install python-binance
and facing this error
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/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 /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-wheel-ivmvv_y7
cwd: /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/regex_3
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.9-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for regex
Running setup.py clean for regex
Failed to build regex
Installing collected packages: regex, dateparser, python-binance
Running setup.py install for regex ... error
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-record-fasv8uk1/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.7m/regex
cwd: /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/regex_3
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.9-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-record-fasv8uk1/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.7m/regex Check the logs for full command output
I have tried solutions from other stackoverflow questions, but nothing worked for me. I also have recently upgraded my macOS to Catalina 10.15.5.
Thank you in advance
Here is the error crashing you pip installer :
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
This error is caused while upgrading your macOS. This line in your console should do the trick.
xcode-select -–install
if this does not work you will need a reset :
sudo xcode-select --reset

Not able to upgrade pycairo in Python3 [duplicate]

This question already has answers here:
fatal error: Python.h: No such file or directory
(35 answers)
Closed 2 years ago.
I am trying to upgrade pycairo package but getting following error:
$ python3 -m pip install -U pycairo
Defaulting to user installation because normal site-packages is not writeable
Collecting pycairo
Using cached pycairo-1.19.1.tar.gz (205 kB)
Installing collected packages: pycairo
Running setup.py install for pycairo ... 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-ho1du2qw/pycairo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ho1du2qw/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-21711no1/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/abcde/.local/include/python3.7m/pycairo
cwd: /tmp/pip-install-ho1du2qw/pycairo/
Complete output (19 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/cairo
copying cairo/__init__.py -> build/lib.linux-x86_64-3.7/cairo
copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.7/cairo
copying cairo/py.typed -> build/lib.linux-x86_64-3.7/cairo
running build_ext
building 'cairo._cairo' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/cairo
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_MINOR=19 -DPYCAIRO_VERSION_MICRO=1 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/python3.7m -c cairo/device.c -o build/temp.linux-x86_64-3.7/cairo/device.o -Wall -Warray-bounds -Wcast-align -Wconversion -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wimplicit-function-declaration -Winit-self -Winline -Wmissing-format-attribute -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wundef -Wunused-but-set-variable -Wswitch-default -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-command-line-argument -fno-strict-aliasing -fvisibility=hidden -std=c99
cairo/device.c:30:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with 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-ho1du2qw/pycairo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ho1du2qw/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-21711no1/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/abcde/.local/include/python3.7m/pycairo Check the logs for full command output.
Where is the problem?
File Python.h means you have to install python-dev with C/C++ headers .h because it has to compile some C/C++ code.
On Linux Mint/Ubuntu/Debian it could be one of this command
apt install python-dev
apt install python3-dev
apt install python3.7-dev

Categories

Resources