![](/img/trans.png)
[英]VirtualEnv on Windows, pip fails to install packages with C-extensions
[英]pip install from a github repo - how to build C-extensions with Cython during egg install
我可以使用以下命令成功安装DMSL软件包
git clone git://github.com/dasacc22/dmsl.git
cd dmsl
sudo python setup.py install
但是当我尝试使用pip
安装时
pip install -e git+git://github.com/dasacc22/dmsl.git#egg=dmsl
我得到一个错误
Obtaining dmsl from git+git://github.com/dasacc22/dmsl.git#egg=dmsl
Updating /Users/andrei/.pythonbrew/venvs/Python-2.7.2/test/src/dmsl clone
Running setup.py egg_info for package dmsl
warning: no files found matching '*.html' under directory 'daml'
warning: no files found matching '*.daml' under directory 'daml'
warning: no files found matching '*.c' under directory 'daml'
Installing collected packages: dmsl
Running setup.py develop for dmsl
warning: no files found matching '*.html' under directory 'daml'
warning: no files found matching '*.daml' under directory 'daml'
warning: no files found matching '*.c' under directory 'daml'
building 'dmsl.cdoc' extension
gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/andrei/.pythonbrew/pythons/Python-2.7.2/include/python2.7 -c dmsl/cdoc.c -o build/temp.macosx-10.7-x86_64-2.7/dmsl/cdoc.o
i686-apple-darwin11-llvm-gcc-4.2: dmsl/cdoc.c: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: no input files
error: command 'gcc' failed with exit status 1
Complete output from command /Users/andrei/.pythonbrew/venvs/Python-2.7.2/test/bin/python -c "import setuptools; __file__='/Users/andrei/.pythonbrew/venvs/Python-2.7.2/test/src/dmsl/setup.py'; exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps:
running develop
running egg_info
writing dmsl.egg-info/PKG-INFO
writing top-level names to dmsl.egg-info/top_level.txt
writing dependency_links to dmsl.egg-info/dependency_links.txt
writing dmsl.egg-info/PKG-INFO
writing top-level names to dmsl.egg-info/top_level.txt
writing dependency_links to dmsl.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'dmsl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.html' under directory 'daml'
warning: no files found matching '*.daml' under directory 'daml'
warning: no files found matching '*.c' under directory 'daml'
writing manifest file 'dmsl.egg-info/SOURCES.txt'
running build_ext
building 'dmsl.cdoc' extension
gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/andrei/.pythonbrew/pythons/Python-2.7.2/include/python2.7 -c dmsl/cdoc.c -o build/temp.macosx-10.7-x86_64-2.7/dmsl/cdoc.o
i686-apple-darwin11-llvm-gcc-4.2: dmsl/cdoc.c: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: no input files
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /Users/andrei/.pythonbrew/venvs/Python-2.7.2/test/bin/python -c "import setuptools; __file__='/Users/andrei/.pythonbrew/venvs/Python-2.7.2/test/src/dmsl/setup.py'; exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps failed with error code 1
Storing complete log in /Users/andrei/.pip/pip.log
我怎样才能解决这个问题?
我已经分叉了仓库并更正了MANIFEST.in
所以在我的仓库中
recursive-include dmsl *.html *.dmsl *.c
它找到* .html和* .dmsl,但是问题是没有* .c文件,我需要使用Cython
创建。 我已经安装了软件包,但是作为python-newbie,我需要被引导进行下一步。 我应该怎么做才能生成C文件? 我是否需要在MANIFEST.in
或setup.py
添加其他内容?
我在freenode#python上获得了一些帮助。 伙计们建议使用python setup.py build_ext
生成C文件,并将其添加到存储库中。 最好避免这种情况。 有没有一种方法可以通过pip install
自动运行build_ext命令?
仅供参考:值得访问freenode#pip以获得此类问题。 在那里,您可能有幸找到jezdez ;)
在安装了Pyrex之后,安装对我有用。 您可能想将Cython和Pyrex添加到setup()调用的installed_requires参数中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.