Python setup.py脚本使用最新版本的virtualenv中断
我有一个通过Python setup.py脚本使用最新版本的virtualenv中断,python,virtualenv,setuptools,Python,Virtualenv,Setuptools,我有一个通过python setup.py install安装的软件包,在我今天早上尝试在一台新机器上安装之前,它一直运行良好 在以前的机器上,virtualenv带有setuptools==2.0.2,但在我的新机器上,它现在是setuptools==3.6 现在,当我使用setup.py install安装软件包时,我无法导入软件包或运行其中包含的脚本 这是软件包的setup.py文件: __version__ = '1.0.2' import sys try: from set
python setup.py install安装的软件包,在我今天早上尝试在一台新机器上安装之前,它一直运行良好
在以前的机器上,virtualenv
带有setuptools==2.0.2
,但在我的新机器上,它现在是setuptools==3.6
现在,当我使用setup.py install
安装软件包时,我无法导入软件包或运行其中包含的脚本
这是软件包的setup.py
文件:
__version__ = '1.0.2'
import sys
try:
from setuptools import setup
print 'Loaded setuptools'
except ImportError:
from distutils.core import setup
print 'Loaded distutils.core'
PACKAGE_NAME = 'google-taskqueue-client'
INSTALL_REQUIRES = ['google-apputils==0.1',
'google-api-python-client',
'httplib2',
'oauth2',
'python-gflags']
setup(name=PACKAGE_NAME,
version=__version__,
description='Google TaskQueue API command-line tool and utils',
author='Google Inc.',
author_email='google-appengine@googlegroups.com',
url='http://code.google.com/appengine/docs/python/taskqueue/pull/overview.html',
install_requires=INSTALL_REQUIRES,
packages=['gtaskqueue'],
scripts=['gtaskqueue/gtaskqueue', 'gtaskqueue/gtaskqueue_puller',
'gtaskqueue/gen_appengine_access_token'],
license='Apache 2.0',
keywords='google taskqueue api client',
classifiers=['Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX',
'Topic :: Internet :: WWW/HTTP'])
安装本身运行良好,但我不能使用包中的模块。
以下是尝试列出的脚本之一时引发的错误:
$ which gtaskqueue
/Users/john/.virtualenvs/myenv/bin/gtaskqueue
$ gtaskueue
Traceback (most recent call last):
File "/Users/john/.virtualenvs/myenv/bin/gtaskqueue", line 5, in <module>
pkg_resources.run_script('google-taskqueue-client==1.0.2', 'gtaskqueue')
File "/Users/john/.virtualenvs/myenv/lib/python2.7/site-packages/pkg_resources.py", line 534, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/Users/john/.virtualenvs/myenv/lib/python2.7/site-packages/pkg_resources.py", line 1441, in run_script
exec(script_code, namespace, namespace)
File "/Users/john/.virtualenvs/myenv/lib/python2.7/site-packages/google_taskqueue_client-1.0.2-py2.7.egg/EGG-INFO/scripts/gtaskqueue", line 25, in <module>
ImportError: No module named gtaskqueue
编辑2:
您是否尝试过pip安装gtaskqueue
?因此,安装顺利进行?是的,安装“正常”。只是无法使用/导入软件包的任何模块。这很奇怪,我甚至无法让安装正常工作。文件到处都丢失了。你确定依赖项没有改变,从而导致上游的文件实际上已经损坏了吗?我注意到你并没有把你所依赖的一切都钉死。
>>> import google.apputils
>>> import httplib2
>>> import oauth2
>>> import gflags
>>> import oauth2client
>>> import gtaskqueue
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named gtaskqueue