【发布时间】:2013-12-01 07:06:16
【问题描述】:
这是我的 setup.py 文件
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='test',
version='0.1',
description='',
author='',
author_email='',
install_requires=[
'django >= 1.2.3',
'pyxmlsec',
'south',
'lxml',
'xlrd'
],
packages=find_packages(exclude=['ez_setup']),
include_package_data=True,
test_suite='nose.collector',
)
运行命令python setup.py install 后,它会在我的site_packges 中安装.egg,但在安装依赖项时会抛出错误:
Processing dependencies for test==0.1
Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Download error on https://pypi.python.org/simple/lxml/: timed out -- Some packages may not be found!
Couldn't find index page for 'lxml' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: timed out -- Some packages may not be found!
No local packages or download links found for lxml
error: Could not find suitable distribution for Requirement.parse('lxml')
不仅lxml 模块,所有其他模块(如xlrd)都会发生相同的错误。尝试的pypi 链接与源代码很好。那么有什么解决办法呢?提前致谢。
【问题讨论】:
-
这是一个连接问题。你连接到互联网了吗?如果使用代理,您的代理设置是否在您的环境中正确(我假设是 linux)?您可以通过
pip install lxml或easy_install lxml手动安装软件包 -
@RedBaron 是的,我可以手动安装模块,但实际上我希望在许多客户端机器中传输代码时,他们不应该手动下载和安装所有模块,运行一个简单的脚本就可以了那。所以我开发了这样的
setup.py。
标签: python django packaging setuptools setup.py