I am trying to install pandas in an EC2 instance using the AWS linux distro for use with Python34.
I ran:
sudo pip install pandas
and I was able to successfully install pandas for the python 2.7 version but when I run:
sudo python34 -m pip install pandas
I get the error:
gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1
-DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ipandas/_libs/src/klib -Ipandas/_libs/src -I/usr/local/lib64/python3.4/site-packages/numpy/core/include -I/usr/include/python3.4m -c pandas/_libs/index.c -o build/temp.linux-x86_64-3.4/pandas/_libs/index.o -Wno-unused-function
pandas/_libs/index.c:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
followed by:
Command "/usr/bin/python34 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zsa12w6w/pandas/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-svj_8okf-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-zsa12w6w/pandas/
How do I successfully install pandas for the python34 version?
I'm guessing you have an old version of pip, otherwise it would try to install via a wheel (binary dist). So one option would be to upgrade pip, then install pandas. (python34 -m pip install -U pip)
If you do want to build pandas from source, or any python c-extension, you need to install the python development headers, probably something like yum install python34-python-devel.x86_64
Related
I am trying to deploy a django project, which makes use of MSSQL Server. I am trying to deploy it using AWS Elastic Beanstalk. If anyone could help me out I would really appreciate it.
I have GCC and G++ working on my computer, so I am not sure why that is causing any problems here. I searched around and wasnt able to find any solution that is directly related to mine, and I am not sure where to move forward from here.
Here is the requirements.txt
astroid==1.6.5
awsebcli==3.14.6
botocore==1.12.9
cement==2.8.2
colorama==0.3.9
Django==2.0.6
django-mssql==1.8
django-pyodbc-azure==2.0.6.1
django-sendgrid-v5==0.6.893
docutils==0.14
future==0.16.0
isort==4.3.4
jmespath==0.9.3
lazy-object-proxy==1.3.1
mccabe==0.6.1
mysql-connector-python-rf==2.2.2
pathspec==0.5.5
pylint==1.9.2
PyMySQL==0.8.1
pyodbc==4.0.23
pypyodbc==1.3.3.1
python-dateutil==2.7.3
python-http-client==3.1.0
pytz==2018.5
PyYAML==3.13
semantic-version==2.5.0
sendgrid==5.4.1
six==1.11.0
style==1.1.0
termcolor==1.1.0
update==0.0.1
urllib3==1.22
wrapt==1.10.11
This is my log, specifically the eb-activity section
/var/log/eb-activity.log
Running setup.py bdist_wheel for pyodbc: started
Running setup.py bdist_wheel for pyodbc: finished with status 'error'
Complete output from command /opt/python/run/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1cdwy0uv/pyodbc/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/tmpxf7u3lwwpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=4.0.23 -I/usr/include/python3.6m -c src/pyodbcmodule.cpp -o build/temp.linux-x86_64-3.6/src/pyodbcmodule.o -Wno-write-strings
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status
Failed building wheel for pyodbc
Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: pyodbc, django-pyodbc-azure, future, python-http-client, sendgrid, django-sendgrid-v5, isort, mccabe, mysql-connector-python-rf, pylint, PyMySQL, pypyodbc, style, update
Running setup.py install for pyodbc: started
Running setup.py install for pyodbc: finished with status 'error'
Complete output from command /opt/python/run/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1cdwy0uv/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-wpg4l1dm-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/python/run/venv/include/site/python3.6/pyodbc:
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=4.0.23 -I/usr/include/python3.6m -c src/pyodbcmodule.cpp -o build/temp.linux-x86_64-3.6/src/pyodbcmodule.o -Wno-write-strings
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
If you do not already have a .ebextensions directory, then create one, and add a file named 01_packages.config to it with the following content:
packages:
yum:
gcc-c++: []
unixODBC-devel: []
When you run eb deploy at your console, then the config files in the .ebextensions directory will be processed before AWS runs pip install on your requirements.txt file, and you should have the right packages installed for your pypyodbc==1.3.3.1 requirement.
I am using the command "pip install glove_python". But it is giving me the below error:
`Running setup.py install for glove-python ... error
Complete output from command /Users/mmt6384/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/xf/hy2wkn4s3nd98k159rpws03nnt3rbk/T/pip-install-eio_81ve/glove-python/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/xf/hy2wkn4s3nd98k159rpws03nnt3rbk/T/pip-record-9ljtw6cb/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running build_ext
building 'glove.glove_cython' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/mmt6384/anaconda3/include -arch x86_64 -I/Users/mmt6384/anaconda3/include -arch x86_64 -I/Users/mmt6384/anaconda3/include/python3.6m -c glove/glove_cython.c -o build/temp.macosx-10.7-x86_64-3.6/glove/glove_cython.o -fopenmp -ffast-math
clang: error: unsupported option '-fopenmp'
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/mmt6384/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/xf/hy2wkn4s3nd98k159rpws03nnt3rbk/T/pip-install-eio_81ve/glove-python/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/xf/hy2wkn4s3nd98k159rpws03nnt3rbk/T/pip-record-9ljtw6cb/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/xf/hy2wkn4s3nd98k159rpws03nnt3rbk/T/pip-install-eio_81ve/glove-python/`
You got this error actually "command 'gcc' failed with exit status 1"
Based on your os, you have some steps to fix it. First of all, make sure you already activate your virtual environment. Visit this site for installing and activating virtualenv.
your Python version is 3.6 you need to install Python Development Package.
deb based : sudo apt-get install python3.6-dev link:
rpm based : sudo yum install python36u-devel link:
if you don't have 'gcc' package you'd better install it before.
I'm trying to install PyAudio on my Raspbery Pi 3 using pip install pyaudio but I'm getting the following error:
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Here are the full logs:
pip install pyaudio
Downloading/unpacking pyaudio
Downloading PyAudio-0.2.11.tar.gz
Running setup.py (path:/tmp/pip-build-u0HEK5/pyaudio/setup.py) egg_info for package pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio
building '_portaudio' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-armv7l-2.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-u0HEK5/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-g5l7H9-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
copying src/pyaudio.py -> build/lib.linux-armv7l-2.7
running build_ext
building '_portaudio' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/src
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-armv7l-2.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Cleaning up...
Command /usr/bin/python -c "import setuptools,
tokenize;__file__='/tmp/pip-build-u0HEK5/pyaudio/setup.py';exec(compile(getattr(tokenize,
'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
'exec'))" install --record /tmp/pip-g5l7H9-record/install-record.txt
--single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-u0HEK5/pyaudio
Storing debug log for failure in /home/pi/.pip/pip.log
Note: this a Detailed steps for the installation, for faster installation please consider using #Julian's answer.
That is because you dont have proper prerequisites for the "pyaudio", and port audio header files are one of them.
so first install the prerequisites then your installation will succeed.
try the below commands first before installing pyaudio.
sudo apt-get update
sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
sudo apt-get install python-dev
after this now install pyaudio installation either from downloaded file or from a git repository
sudo pip install pyaudio
or
sudo apt-get install git
sudo git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
cd pyaudio
sudo python setup.py install
anything else leave a comment below.
This is related to Pyaudio installation error - 'command 'gcc' failed with exit status 1'
Try the same solution:
sudo apt-get install python-pyaudio
sudo python3 -m pip install textract
sudo apt-get install textract
pip install textract
sudo apt-get install swig
I want to install textract in python3 but it is not install proper way, it gives the following error.
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 -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python2.7 -c swig/sphinxbase/ad_wrap.c -o build/temp.linux-x86_64-2.7/swig/sphinxbase/ad_wrap.o -Wno-unused-label -Wno-strict-prototypes -Wno-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-misleading-indentation
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 -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DSPHINX_DLL -DHAVE_CONFIG_H -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/android -I/usr/include/python2.7 -c deps/sphinxbase/src/libsphinxad/ad_pulse.c -o build/temp.linux-x86_64-2.7/deps/sphinxbase/src/libsphinxad/ad_pulse.o -Wno-unused-label -Wno-strict-prototypes -Wno-parentheses -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -Wno-sign-compare -Wno-misleading-indentation
deps/sphinxbase/src/libsphinxad/ad_pulse.c:44:30: fatal error: pulse/pulseaudio.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Follow these steps:
Download the source file for textract from: https://pypi.python.org/pypi/textract
pip3 install pdfminer3k
untar the downloaded file
cd into the directory
run: python3 setup.py install
You will need to install the libpulse-dev in Ubuntu or pulseaudio-libs-devel in Fedora first.
If you are in Ubuntu try sudo apt-get install libpulse-dev
If you are in Fedora try sudo dnf install pulseaudio-libs-devel
At least this works for me.
First install pip in conda. python -m pip install --upgrade pip
then install textract, pip install textract
Late reply, but instead of pip you should check out conda it's much more encapsulated in regards to installing this package.
To install this package with conda run one of the following:
conda install -c conda-forge textract
conda install -c conda-forge/label/cf201901 textract
conda install -c conda-forge/label/cf202003 textract
Source:
https://anaconda.org/conda-forge/textract
You can install it using the following command:
pip install git+https://github.com/deanmalmgren/textract.git
Good day. I'm trying to install in a virtual environment. I tried different tips, but the error persists. My system is Ubuntu 14.04.
(.env)volody#volody-MVG:~/program/MyProject/eveportal$ pip install psycopg2
Collecting psycopg2
Using cached psycopg2-2.6.1.tar.gz
Installing collected packages: psycopg2
Running setup.py install for psycopg2
Complete output from command /home/volody/program/MyProject/eveportal/.env/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-8OJou3/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-29kcwo-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/volody/program/MyProject/eveportal/.env/include/site/python2.7/psycopg2:
...
copying tests/test_async.py -> build/lib.linux-x86_64-2.7/psycopg2/tests
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/psycopg
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.1 (dt dec mx pq3 ext lo64)" -DPG_VERSION_HEX=0x09030A -DHAVE_LO64=1 -I/usr/include/python2.7/mx -I/usr/include/python2.7 -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.3/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
»» option ‘-Qunused-arguments’ «« : Seems to be a "pip" thing.
`psycopg2-2.6.1' can easily be installed on Ubuntu 14.04 - 64bits with:
$ cd psycopg2-2.6.1/ && sudo python setup.py install