我可以使用以下命令成功安装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('rn', '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('rn', 'n'), __file__, 'exec'))" develop --no-deps failed with error code 1
Storing complete log in /Users/andrei/.pip/pip.log
我该如何解决这个问题?
EDIT1:
我已经fork了repo并更正了MANIFEST.in
,所以在我的repo中它有
recursive-include dmsl *.html *.dmsl *.c
查找*.html和*.html。dmsl,但问题是没有*.c文件,我需要用Cython
创建。我已经安装了这个包,但是作为一个python新手,我需要被引导到下一步。我应该怎样制作c文件?我需要在MANIFEST.in
或setup.py
中添加其他东西吗?
EDIT2:
我在freenode#python上得到了一些帮助。伙计们建议用python setup.py build_ext
制作c文件,并将它们添加到repo中。能避免这种情况就好了。是否有一种方法来运行build_ext命令自动与pip install
?
仅供参考:这类问题值得访问freenode#pip。在那里你可能会幸运地找到jezdez;)
安装Pyrex后,安装工作为我。您可能希望将Cython和Pyrex添加到setup()调用的installd_requires参数中。