我剛剛用setuptool做了一個Python包,但是我面臨一個問題,如果我預先安裝了Ubuntu庫中的所有工具,但是當我使用PyPi時,安裝失敗,因爲PyPi只包含源代碼,需要編譯,所以在安裝過程中有很多錯誤源。我如何在我的軟件包安裝過程中安裝Ubuntu軟件包?我的想法是subprocess,有沒有更好的方法?如何在安裝程序中安裝PyPi的Ubuntu軟件包?
EDITED
該錯誤消息
Reading http://pypi.python.org/simple/enable/
Reading http://code.enthought.com/projects/enable
Best match: enable 4.2.0
Downloading http://www.enthought.com/repo/ets/enable-4.2.0.tar.gz
Processing enable-4.2.0.tar.gz
Writing /tmp/easy_install-wuMg8s/enable-4.2.0/setup.cfg
Running enable-4.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-wuMg8s/enable-4.2.0/egg-dist-tmp-LbjqHY
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:548: UserWarning: Specified path /usr/local/include/python2.7 is invalid.
warnings.warn('Specified path %s is invalid.' % d)
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:548: UserWarning: Specified path is invalid.
warnings.warn('Specified path %s is invalid.' % d)
Warning: distutils distribution has been initialized, it may be too late to add a library freetype2_srcWarning: distutils distribution has been initialized, it may be too late to add a library agg24_srcWarning: distutils distribution has been initialized, it may be too late to add a library kiva_srcWarning: distutils distribution has been initialized, it may be too late to add an extension _agg/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:548: UserWarning: Specified path /usr/X11R6/lib is invalid.
warnings.warn('Specified path %s is invalid.' % d)
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:548: UserWarning: Specified path /usr/X11/lib is invalid.
warnings.warn('Specified path %s is invalid.' % d)
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:548: UserWarning: Specified path /usr/X11R6/include is invalid.
warnings.warn('Specified path %s is invalid.' % d)
/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:548: UserWarning: Specified path /usr/X11/include is invalid.
warnings.warn('Specified path %s is invalid.' % d)
error: X11 libraries not found.
安裝腳本:
from setuptools import setup
setup(
name = 'SomeName',
version = '0.1',
packages = ['src'],
author = 'Some Author',
maintainer = 'Some',
maintainer_email = '[email protected]',
description = '',
url = 'www.some.com',
install_requires = ['envisage >= 4.0',
'pyface >= 4.0',
'apptools >= 4.0',
'chaco >= 4.0',
'traits >= 4.0',
'traitsui >= 4.0',
'mysql-connector-python >= 1.0',
'pysnmp >= 4.2',
'pyasn1 >= 0.1.4',
'M2Crypto >= 0.21.1',
'netifaces >= 0.7'
],
)
從PyPi安裝應該可以正常工作。我認爲你做錯了什麼。 – Sibi
如果您提供錯誤信息,可能對我們有幫助。 – Sibi
我發佈了錯誤訊息 –