Ubuntu – I cannot install Python modules

12.10error handlinginstallationmodulespython-2.7

When I try to use pip or easy_install I am getting following errors for any kind of modules I try to install. I ve looked for all the output errors but I dont understand th reason behind.

Searching for orange
Reading http://pypi.python.org/simple/orange/
Reading http://orange.biolab.si
Reading http://orange.biolab.si/svn/orange/trunk
Reading http://orange.biolab.si/
Reading https://bitbucket.org/biolab/orange/downloads
Best match: Orange 2.6
Downloading http://pypi.python.org/packages/source/O/Orange/Orange-2.6.tar.gz#md5=7c8e4636cc02984a1bb58c3cd45a5d45
Processing Orange-2.6.tar.gz
Writing /tmp/easy_install-X9yvWi/Orange-2.6/setup.cfg
Running Orange-2.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-X9yvWi/Orange-2.6/egg-dist-tmp-rhPYKh
Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules _winreg, win32api or win32con are installed.
warning: no previously-included files matching '*' found under directory 'source/orangeqt/build'
no previously-included directories found matching 'source/orange/px'
no previously-included directories found matching 'source/orange/ppp'
no previously-included directories found matching 'source/orangeom/px'
no previously-included directories found matching 'source/orangene/ppp'
no previously-included directories found matching 'source/orangene/px'
no previously-included directories found matching 'source/orangene/ppp'
warning: no previously-included files found matching 'source/orangeom/lib_vectors.cpp'
warning: no previously-included files found matching 'source/orangene/lib_vectors.cpp'
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from source/include/stat.cpp:24:
source/include/stat.hpp: In function ‘T moment(const std::vector<T, std::allocator<_Tp1> >&, const int&)’:
source/include/stat.hpp:418: warning: suggest explicit braces to avoid ambiguous ‘else’
source/include/stat.hpp: In function ‘T loess_y(const T&, std::map<T, U, std::less<_Key>, std::allocator<std::pair<const _Key, _Tp> > >, const float&)’:
source/include/stat.hpp:1415: warning: suggest explicit braces to avoid ambiguous ‘else’
source/include/stat.cpp: In function ‘void samplingMinimal(const std::map<double, double, std::less<double>, std::allocator<std::pair<const double, double> > >&, int, std::vector<double, std::allocator<double> >&)’:
source/include/stat.cpp:85: warning: comparison between signed and unsigned integer expressions
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from source/include/c2py.cpp:22:
source/include/c2py.hpp:25: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

this is a specific output for orange machine learning library with easy_install. pip also causes nearly same results.

Is there any one who sees the reason of the error?

Best Answer

Do you have python-dev package installed? Installing C and C++ modules requires the Python headers inside that package.

Related Question