当我尝试使用 pip 或 easy_install 时,我尝试安装的任何类型的模块都会出现以下错误。我查找了所有输出错误,但我不明白背后的原因。
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
这是带有 easy_install 的橙色机器学习库的特定输出。pip 也导致几乎相同的结果。
有谁知道错误的原因吗?
答案1
您是否python-dev
安装了软件包?安装 C 和 C++ 模块需要该软件包内的 Python 头文件。