I got the following error while trying to install pyaudio using pip3 in ubuntu 16.04:
Collecting pyaudio
Downloading PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-mxgvewdb/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 /tmp/pip-v55chjee-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
copying src/pyaudio.py -> build/lib.linux-x86_64-3.5
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.5/src/_portaudiomodule.o
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-mxgvewdb/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 /tmp/pip-v55chjee-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-mxgvewdb/pyaudio/
This should help
$ sudo apt-get install portaudio19-dev python-pyaudio python3-pyaudio
Tested on Ubuntu 18.04, Python 3.7.2, pyaudio 0.2.11
Added 8th of Jan 2021:
On Ubuntu 20.04 you have to use:
$ sudo apt install portaudio19-dev python3-pyaudio
For Windows, here's what I've been going through...
There're several ways to install PortAudio
vcpkg, https://vcpkg.info/port/portaudio
winget, https://winget.run/pkg/intxcc/pyaudio
Or, manually build from source and install manually
download source, http://files.portaudio.com/download.html
build with cmake, with the matching compiler(msvc/mingw) and arch(x64/x86) to your Python
put "portaudio.h" into python-include directory, e.g. c:\Python38-32\include\
put "portaudio.lib into python-lib directory, e.g. c:\Python38-32\libs
Arrh!
the "min()" macro in pyaudio's soucefile _portaudiomodule.c is troublesome, comment it out manually
pip install pyaudio --no-clean
find _portaudiomodule.c in the temp directory and manually comment-out the "min()" macro e.g. c:\Temp\pip-install-yysb8bme\pyaudio_c92585\src\_portaudiomodule.c
pip install from that directorye.g. pip install c:\Temp\pip-install-yysb8bme\pyaudio_c92585\
Or,3rd party wheels
this answer said:
pip install pipwinpipwin install pyaudio
For MacOS (Intel/Apple Silicon):
Step 1:
brew install portaudio
Step 2:
brew --prefix portaudio
The output provided from the above command, will be required in Step 3, which will look something similar to /opt/homebrew/opt/portaudio
Step 3:
Create .pydistutils.cfg in your home directory
sudo nano ~/.pydistutils.cfg
then paste the following in the file, save and exit
[build_ext]
include_dirs=<PATH FROM STEP 2>/include/
library_dirs=<PATH FROM STEP 2>/lib/
Step 4:
pip3 install pyaudio
For Centos7/RHEL:
yum install portaudio-devel alsa-lib-devel portaudio
pip install pyaudio --user
Related
I'm trying to install chatterbot on macOS with
python3 -m pip install chatterbot
and every time I get the same error during the step "Installing build dependencies ... /"
ERROR: Failed building wheel for spacy
Running setup.py clean for spacy
Failed to build spacy
ERROR: Could not build wheels for spacy which use PEP 517 and cannot be installed directly
Can someone please help?
Installing collected packages: spacy, chatterbot
Running setup.py install for spacy ... error
ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/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/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-record-z9jsui8q/install-record.txt --single-version-externally-managed --compile:
ERROR: 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/spacy
copying spacy/lemmatizer.py -> build/lib.macosx-10.9-x86_64-3.7/spacy
running build_ext
building 'spacy._align' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/spacy
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c spacy/_align.cpp -o build/temp.macosx-10.9-x86_64-3.7/spacy/_align.o -O2 -Wno-strict-prototypes -Wno-unused-function -stdlib=libc++
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 "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/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/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-record-z9jsui8q/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/
You could try python3 -m pip install --no-binary spacy chatterbot, which should tell pip to not build the wheel
Alternately python3 -m pip install --no-use-pep517 chatterbot.
I had the same problem while installing kivy through command prompt.
If you use Pycharm then there is an easy way to avoid these problems.
Open Pycharm-->GoTo Files-->Settings-->Project-->Python Interpreter--> + sign-->then search for what you want to install. Check the version which works for you and install it.
If you get an error then try and install other versions of it. That would solve the issue.
Try installing the python-dev version.
For python3.7
sudo apt-get install python3.7-dev
For python3.6
sudo apt-get install python3.6-dev
In one of the scenarios where if you are using Anaconda, then you have to install using this command:
conda install -c conda-forge spacy, hope this helps !!
I had this issue with MacOS for a different package. I found this warning in the log:
WARNING: Building wheel for bottleneck failed: [Errno 13] Permission denied: '/Users/avi/Library/Caches/pip/wheels/87'
Then I gave my user access to the pip/wheels directory and then the installation worked.
Easy, try to run this:
pip install pep517
And then try to install again
python3 -m pip install chatterbot
I've upgraded pip to 19.0.3. Then I removed pip==19.0.3 and reinstalled pip9.0.1. Now every time I try to install anything this message keeps coming up.
You are using pip version 9.0.1, however, version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip'
command.
Please help me out.
Also i'm not able to install any more python packages.
pip install pyAudio
> Collecting pyAudio Using cached
> https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
> Building wheels for collected packages: pyAudio Running setup.py
> bdist_wheel for pyAudio ... error Complete output from command
> /usr/bin/python -u -c "import setuptools,
> tokenize;__file__='/tmp/pip-build-sBep_e/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
> /tmp/tmpJr7LNvpip-wheel- --python-tag cp27: running bdist_wheel
> running build running build_py creating build creating
> build/lib.linux-x86_64-2.7 copying src/pyaudio.py ->
> build/lib.linux-x86_64-2.7 running build_ext building '_portaudio'
> extension creating build/temp.linux-x86_64-2.7 creating
> build/temp.linux-x86_64-2.7/src x86_64-linux-gnu-gcc -pthread
> -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
> src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file
> or directory #include "portaudio.h"
> ^~~~~~~~~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
> ---------------------------------------- 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 ... error
> Complete output from command /usr/bin/python -u -c "import setuptools,
> tokenize;__file__='/tmp/pip-build-sBep_e/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 /tmp/pip-72KZyy-record/install-record.txt --single-version-externally-managed --compile:
> running install
> running build
> running build_py
> creating build
> creating build/lib.linux-x86_64-2.7
> copying src/pyaudio.py -> build/lib.linux-x86_64-2.7
> running build_ext
> building '_portaudio' extension
> creating build/temp.linux-x86_64-2.7
> creating build/temp.linux-x86_64-2.7/src
> x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
> src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file or directory
> #include "portaudio.h"
> ^~~~~~~~~~~~~
> compilation terminated.
> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
>
> ---------------------------------------- Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-sBep_e/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 /tmp/pip-72KZyy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-sBep_e/pyAudio/ You are using pip version 9.0.1,
> however version 19.0.3 is available. You should consider upgrading via
> the 'pip install --upgrade pip' command.
Installing pydev solved 'x86_64-linux-gnu-gcc' error for me!
easy as:
sudo apt-get install python-dev
You may also need build-essential for similar issues,
sudo apt-get install build-essential
Hope this helps.
You need to install portaudio dev package:
Download binary files of portaudio from here
Extract it to somewhere
in terminal go to that directory (with cd /where/you/extract/those)
run this command there: ./configure
run this: make
and this one: sudo make install
now you can install portaudio with pip:
$ sudo pip install pyAudio
Installing collected packages: pyAudio
Running setup.py install for pyAudio ... done
Successfully installed pyAudio-0.2.11
Try this sudo apt-get install python-pyaudio.
Thhis should work!
The only thing you need to do is upgrading the pip utility to latest version by using one these commands
pip install pip setuptools -U
or
pip install --upgrade pip
Note: You may need to add 'sudo' as prefix, if you're working on system level python installation.
I would like to install PyV8. I install it via:
sudo pip3 install pyv8
I receive error message:
Collecting pyv8
Downloading https://files.pythonhosted.org/packages/c6/fb/5c0512a373e3d0aad0b683f439e7bdd67f95a69e6473b76dc2cfdca2c43f/PyV8-0.5.zip
Installing collected packages: pyv8
Running setup.py install for pyv8 ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0yqr1qf0/pyv8/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-u2aby1pu/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
copying PyV8.py -> build/lib.linux-x86_64-3.5
running build_ext
building '_PyV8' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DBOOST_PYTHON_STATIC_LIB -Ilib/python/inc -Ilib/boost/inc -Ilib/v8/inc -I/usr/include/python3.5m -c src/Exception.cpp -o build/temp.linux-x86_64-3.5/src/Exception.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from src/Exception.cpp:1:0:
src/Exception.h:6:16: fatal error: v8.h: No such file or directory
#include <v8.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0yqr1qf0/pyv8/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-u2aby1pu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-0yqr1qf0/pyv8/
I have installed python3-dev latest. How should I solved this issue? It looks like some header missing, but how should I know what to install?
I solved by applying the following sets of commands. My Python is 2.7.15.
sudo apt-get install libboost-all-dev
sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev
sudo easy_install greenlet
sudo easy_install gevent
git clone https://github.com/buffer/pyv8.git
cd pyv8
sudo python setup.py build
sudo python setup.py install
The instruction was found here - https://github.com/buffer/thug/issues/170#issuecomment-225762492
I just run this command:
sudo pip install pyodbc
then I get below message and error:
steven81#PythonWEBVM:~$ sudo pip install pyodbc
The directory '/home/steven81/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/steven81/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pyodbc
Downloading https://files.pythonhosted.org/packages/aa/71/cef225c4889620a1a00251d24c1746fe0cf4124290a75d1c2dc5c187b61f/pyodbc-4.0.23.tar.gz (215kB)
100% |████████████████████████████████| 225kB 13.5MB/s
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NR7ytY/pyodbc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-voJYBN/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPYODBC_VERSION=4.0.23 -I/usr/include/python2.7 -c src/pyodbcmodule.cpp -o build/temp.linux-x86_64-2.7/src/pyodbcmodule.o -Wno-write-strings
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from src/pyodbcmodule.cpp:11:0:
src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NR7ytY/pyodbc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-voJYBN/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-NR7ytY/pyodbc/
I saw there is an error:
command 'x86_64-linux-gnu-gcc' failed with exit status 1
then I search in on google, it asked to run this:
sudo apt-get install python-dev
so, I run this but get below message:
steven81#PythonWEBVM:~$ sudo apt-get install python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-dev is already the newest version (2.7.12-1~16.04).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
so what's the problem and how to install pyodbc correctlly?
For anyone looking for the pyodbc install to connect to SQLServer from Linux(ubuntu).
sudo apt-get install unixodbc-dev
sudo apt-get install python3-dev
python3 -m pip install pyodbc
I was trying to work on Pyladies website on my local folder. I cloned the repo, (https://github.com/pyladies/pyladies) ! and created the virtual environment. However when I do the pip install -r requirements, I am getting this error
Installing collected packages: gevent, greenlet
Running setup.py install for gevent
building 'gevent.core' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -I/opt/local/include -fPIC -I/usr/include/python2.7 -c gevent/core.c -o build/temp.linux-i686-2.7/gevent/core.o
In file included from gevent/core.c:253:0:
gevent/libevent.h:9:19: fatal error: event.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Complete output from command /home/akoppad/virt/pyladies/bin/python -c "import setuptools;__file__='/home/akoppad/virt/pyladies/build/gevent/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-4MSIGy-record/install-record.txt --install-headers /home/akoppad/virt/pyladies/include/site/python2.7:
running install
running build
running build_py
running build_ext
building 'gevent.core' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -I/opt/local/include -fPIC -I/usr/include/python2.7 -c gevent/core.c -o build/temp.linux-i686-2.7/gevent/core.o
In file included from gevent/core.c:253:0:
gevent/libevent.h:9:19: fatal error: event.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /home/akoppad/virt/pyladies/bin/python -c "import setuptools;__file__='/home/akoppad/virt/pyladies/build/gevent/setup.py'; exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-4MSIGy-record/install-record.txt --install-headers /home/akoppad/virt/pyladies/include/site/python2.7 failed with error code 1 in /home/akoppad/virt/pyladies/build/gevent
Storing complete log in /home/akoppad/.pip/pip.log.
I tried doing this,
sudo port install libevent
CFLAGS="-I /opt/local/include -L /opt/local/lib" pip install gevent
It says port command not found.
I am not sure how to proceed with this. Thanks!
I had the same problem and just as the other answer suggested I had to install "libevent". It's apparently not called "libevent-devel" anymore (apt-get couldn't find it) but doing:
$ apt-cache search libevent
listed a bunch of available packages.
$ apt-get install libevent-dev
worked for me.
I think you just forget to install the "libevent" in the environment. If you are on a OSX machine, please try to install brew here http://mxcl.github.io/homebrew/ and use brew install libevent to install the dependency. If you are on an ubuntu machine, you can try apt-get to install the corresponding library.
I had this issue while trying to
pip install Flask-Sockets
and
sudo apt-get install libevent-dev
worked for me
yum install libevent-*
This command works for me because I am on centos.
I ran into this error on MacOS 10.10.1 (Yosemite) running pip install. The solution for me was to add the path to libevent which pip was missing. These are C files, and CFLAGS and DFLAGS are bash environment variables that let pip know where to find these files. On my system, libevent is found at /usr/local/include/event2.
$ CFLAGS=-I/usr/local/include/event2 DFLAGS=-L/usr/local/lib pip install -r requires.txt