我刚刚用 setuptool 制作了一个 Python 包,但是我遇到了一个问题,如果我从 Ubuntu 存储库中预安装所有东西,它的工作,但是当我使用 PyPi 时,安装失败,因为在 PyPi 上只包含源并且它必须是编译,所以安装过程中有很多错误源。在安装包期间如何安装 Ubuntu 包?我的想法是subprocess,有没有更好的方法?
已编辑
错误信息
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 = 'some@email.com',
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'
],
)