安装了python找不到script_Python脚本找不到安装i的发行版

在尝试运行一个Python egg文件时遇到了错误,脚本无法找到所需资源。错误提示显示'DistributionNotFound',问题可能出在pkg_resources模块。尽管安装过程完成且脚本位于路径中,但每次调用都会报错。问题似乎影响所有通过这种方式运行的脚本。
摘要由CSDN通过智能技术生成

我正在传送一个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\目录中,该目录位于路径上。在

如果有人知道出了什么问题,我们将不胜感激。在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值