我正在传送一个egg文件,但是我可以通过调用一个egg文件来生成一个错误的脚本:C:\Users\286344>testScript.py
Traceback (most recent call last):
File "C:\Users\286344\Downloads\WinPython-32bit-2.7.6.4\python-2.7.6\Scripts\t
estScript.py", line 4, in
import pkg_resources
File "build\bdist.win-amd64\egg\pkg_resources.py", line 2749, in
File "build\bdist.win-amd64\egg\pkg_resources.py", line 444, in _build_master
File "build\bdist.win-amd64\egg\pkg_resources.py", line 725, in require
File "build\bdist.win-amd64\egg\pkg_resources.py", line 628, in resolve
pkg_resources.DistributionNotFound: testScript==0.0
我不认为错误出在脚本本身,因为同样的错误在我尝试以这种方式运行的所有脚本中都很明显。在
基本脚本是我所能想到的最简单的:
^{pr2}$
easy_install在\Scripts\目录中获取并生成:#!C:\Users\286344\Downloads\WinPython-32bit-2.7.6.4\python-2.7.6\python.exe
# EASY-INSTALL-SCRIPT: 'testScript==0.0','testScript.py'
__requires__ = 'testScript==0.0'
import pkg_resources
pkg_resources.run_script('testScript==0.0', 'testScript.py')
以及设置.py具体如下:from setuptools import setup
setup(name='testScript',
version='0.0',
scripts=['testScript.py'],)
python setup.py bdist_egg命令以及要安装的easy_install testScript-0.0-py2.7.egg命令将顺利完成。脚本确实出现在my\Scripts\目录中,该目录位于路径上。在
如果有人知道出了什么问题,我们将不胜感激。在