anyone has install scipy on aws free tier? - python

I've got problem when pip install scipy on aws micro instance, which has only 512 MB memory.
lapack-devel, blas-devel, and numpy already installed.
some one said the memory is too small to build c++ when install scipy.
if anyone succeeded or has similar binary scipy install image, please lend a hand.
image:
Linux ip-172-31-16-186 3.4.43-43.43.amzn1.x86_64 #1 SMP Mon May 6 18:04:41 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
last building log:
scipy/sparse/sparsetools/csr_wrap.cxx: In function ‘void init_csr()’:
scipy/sparse/sparsetools/csr_wrap.cxx:73303:21: warning: variable ‘md’ set but not used [-
Wunused-but-set-variable]
{standard input}: Assembler messages:
{standard input}:115706: Warning: end of file not at end of a line; newline inserted
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
error: Command "g++ -pthread -fno-strict-aliasing -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 -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 -D__STDC_FORMAT_MACROS=1 -I/home/ec2-user/ env/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c scipy/sparse/sparsetools/ csr_wrap.cxx -o build/temp.linux-x86_64-2.7/scipy/sparse/sparsetools/csr_wrap.o" failed with exit status 4

Related

gcc cannot find file even though it is on the include path

I'm trying to install a local Python package on Scientific Linux 7.9, Python version 3.8. The package contains Cython so needs Python headers to build. This is installed and is on the include path, but gcc is still claiming it can't find it. Is this a permissions issue?
$ python setup.py install
running install
...
building 'farm.rasters.water_fill' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64
-mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/rh-python38/root/usr/include -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/rh-python38/root/usr/include
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC
-I/home/jon/.jenkins/workspace/Farmmap_revision_linux_py36/TOXENV/py38/venv/lib64/python3.8/site-packages/numpy/core/include
-I/home/jon/.jenkins/workspace/Farmmap_revision_linux_py36/TOXENV/py38/venv/include
-I/opt/rh/rh-python38/root/include/python3.8 -c farm/rasters/water_fill.c
-o build/temp.linux-x86_64-3.8/farm/rasters/water_fill.o
farm/rasters/water_fill.c:19:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
I have installed rh-python38-python-devel, which includes the headers and they are in the -I path given above.
$ ls -l /opt/rh/rh-python38/root/usr/include/python3.8/
...
-rw-r--r--. 1 root root 3615 Jun 28 11:08 Python.h
Do I just need to chown this directory? I haven't needed to do this on other machines I have installed the package on.
I have figured it out - while the executables /usr/bin/python and /bin/python appear to be the same, only one of them has the associated header files.
When I create a venv using
$ /opt/rh/rh-python38/root/usr/bin/python3.8 -m venv venv
I can build my project, but when I create the venv with
$ /opt/rh/rh-python38/root/bin/python3.8 -m venv venv
I cannot.
When I try to look for the includes associated with the second executable, there is nothing there.
$ ls /opt/rh/rh-python38/root/include/python3.8
ls: cannot access /opt/rh/rh-python38/root/include/python3.8: No such file or directory
if it is not showing path and showing a you a "path not found" error.
Simply try to open windows PowerShell as administrator and type a command
sfc /scannow and wait for some minutes if it will show you that it found some files are corrupted or other corrupted warnings. then you simply run a command
Dism /Online /Cleanup-Image /RestoreHealth and wait for half an hour, it takes time and restart your PC and then check again if it is working or not.
Hope its Helps you 🙂.

gcc cannot find cc1plus

I'm trying to install the python package pandas on CentOS 6 but I'm having problems with the gcc compiler:
sudo pip install pandas
...
creating build/temp.linux-x86_64-2.7/pandas/msgpack
gcc -pthread -fno-strict-aliasing -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 -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 -D__LITTLE_ENDIAN__=1 -Ipandas/src/msgpack -Ipandas/src/klib -Ipandas/src -I/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include -I/opt/rh/python27/root/usr/include/python2.7 -c pandas/msgpack/_packer.cpp -o build/temp.linux-x86_64-2.7/pandas/msgpack/_packer.o -Wno-unused-function
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
...
So it appears I need cc1plus, which by reading around requires gcc-g++. But I already have gcc-c++:
sudo yum install gcc-c++
...
Package gcc-c++-4.4.7-16.el6.x86_64 already installed and latest version
Nothing to do
About gcc and cc1plus:
gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
which gcc
/opt/rh/devtoolset-2/root/usr/bin/gcc
locate cc1plus
/usr/libexec/gcc/x86_64-redhat-linux/4.4.4/cc1plus
My own solution below. Does anybody have better ways of addressing the problem?
Solution to my own question:
It seems that cc1plus, although present, is not visible to gcc as it is not on path. So a solution is to link cc1plus to a directory on PATH:
sudo ln -s /usr/libexec/gcc/x86_64-redhat-linux/4.4.4/cc1plus /usr/local/bin/
Now sudo pip install pandas succeeds.
(But why the package manager put cc1plus there in the first place?)

SciPy installation fails: quadpack error

I tried to install scipy on my user account ~/local using both easy_install and the 'python setup.py install' method with source files. I get this error:
error: Setup script exited with error:
Command "gcc -pthread -fno-strict-aliasing -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 -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
-I/usr/lib64/python2.6/site-packages/numpy/core/include -I/usr/include/python2.6
-c scipy/integrate/_quadpackmodule.c
-o build/temp.linux-x86_64-2.6/scipy/integrate/_quadpackmodule.o"
failed with exit status 1
I'm using 'gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)'. Could this issue be related to the compiler or python2.6 version? Otherwise what could I check?
Thanks!
F.

Error when installing pyodbc-3.0.6 on Fedora

I am trying to install pyodbc-3.0.6 on Fedora.
I had downloaded it from here
When I run it with python setup.py install it's displaying the following error
running install
running bdist_egg
running egg_info
writing pyodbc.egg-info/PKG-INFO
writing top-level names to pyodbc.egg-info/top_level.txt
writing dependency_links to pyodbc.egg-info/dependency_links.txt
writing pyodbc.egg-info/PKG-INFO
writing top-level names to pyodbc.egg-info/top_level.txt
writing dependency_links to pyodbc.egg-info/dependency_links.txt
reading manifest file 'pyodbc.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'tests/*'
writing manifest file 'pyodbc.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/home
creating build/temp.linux-x86_64-2.7/home/local
creating build/temp.linux-x86_64-2.7/home/local/PENNYWISE
creating build/temp.linux-x86_64-2.7/home/local/PENNYWISE/shivakrishnab
creating build/temp.linux-x86_64-2.7/home/local/PENNYWISE/shivakrishnab/Desktop
creating build/temp.linux-x86_64-2.7/home/local/PENNYWISE/shivakrishnab/Desktop/pyodbc-3.0.6
creating build/temp.linux-x86_64-2.7/home/local/PENNYWISE/shivakrishnab/Desktop/pyodbc-3.0.6/src
gcc -pthread -fno-strict-aliasing -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 -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=3.0.6 -I/usr/include/python2.7 -c /home/local/user/Desktop/pyodbc-3.0.6/src/buffer.cpp -o build/temp.linux-x86_64-2.7/home/local/user/Desktop/pyodbc-3.0.6/src/buffer.o -Wno-write-strings
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
Can anyone let me know how to solve this.
Edited Code:
After installing g++ as indicated by below command and when I run the following command
python setup.py install
from inside the pyodbc downloaded folder I got the following error
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'pyodbc' extension
gcc -pthread -fno-strict-aliasing -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 -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=3.0.6 -I/usr/include/python2.7 -c /home/local/user/Desktop/pyodbc-3.0.6/src/buffer.cpp -o build/temp.linux-x86_64-2.7/home/local/user/Desktop/pyodbc-3.0.6/src/buffer.o -Wno-write-strings
In file included from /home/local/user/Desktop/pyodbc-3.0.6/src/buffer.cpp:12:0:
/home/local/user/Desktop/pyodbc-3.0.6/src/pyodbc.h:48:17: fatal error: sql.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
You need to install g++ package. yum install compat-gcc-34-c++
(edit: it seems they moved it to compat-gcc-34-c++)
[edit]
For the second issue - you are missing unixODBC-devel package.
For CentOS the package name is gcc-c++
To suppress the exception:
sql.h: No file or directory in CentOS install unixODBC-devel.x86_64
Run the following command for 64-bit:
yum install unixODBC-devel.x86_64

Python: mysqldb install error

So i've been pulling my hair out trying to install the mysqldb package.
When i run the build i get a long transcript of errors, heres just part of it, i would posit it all but its huge list of errors
[rv#med240-183 MySQL-python-1.2.3c1]$ sudo python setup.py build
[sudo] password for rv:
running build
running build_py
copying MySQLdb/release.py -> build/lib.linux-i686-2.6/MySQLdb
running build_ext
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -Dversion_info=(1,2,3,'gamma',1) -D__version__=1.2.3c1 -I/usr/include/mysql -I/usr/include/python2.6 -c _mysql.c -o build/temp.linux-i686-2.6/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX
_mysql.c:36:23: error: my_config.h: No such file or directory
_mysql.c:38:19: error: mysql.h: No such file or directory
Any ideas?
yum install mysql-devel

Categories

Resources