从pexpect运行已安装的软件包

问题描述 投票:0回答:1

我已经下载了pyocd并成功构建了它。现在,我可以从任何位置从命令行运行该工具。但是,当尝试使用pexpect运行它时,它显示以下错误:

Traceback (most recent call last):
  File "c:\Users\elephant\AppData\Local\Programs\Python\Python37-32\Scripts\pyocd-script.py", line 6, in <module>
    from pkg_resources import load_entry_point
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "C:\Projects\runner\mytest\venv\lib\site-packages\setuptools-39.1.0-py3.7.egg\pkg_resources\__init__.py", line 3086, in <module>
  File "C:\Projects\runner\mytest\venv\lib\site-packages\setuptools-39.1.0-py3.7.egg\pkg_resources\__init__.py", line 3070, in _call_aside
  File "C:\Projects\runner\mytest\venv\lib\site-packages\setuptools-39.1.0-py3.7.egg\pkg_resources\__init__.py", line 3099, in _initialize_master_working_set
  File "C:\Projects\runner\mytest\venv\lib\site-packages\setuptools-39.1.0-py3.7.egg\pkg_resources\__init__.py", line 574, in _build_master
  File "C:\Projects\runner\mytest\venv\lib\site-packages\setuptools-39.1.0-py3.7.egg\pkg_resources\__init__.py", line 892, in require
  File "C:\Projects\runner\mytest\venv\lib\site-packages\setuptools-39.1.0-py3.7.egg\pkg_resources\__init__.py", line 778, in resolve
pkg_resources.DistributionNotFound: The 'pyocd==0.14.1.dev277+dirty' distribution was not found and is required by the application

请帮助从命令行了解错误及其原因?

python python-3.x pexpect pkg-resources
1个回答
0
投票

问题是我试图产生pyocd.exe并且pexpect无法找到包裹。我把线改为python -m pyocd,它运行正常。我是Python的新手,并错误地认为exe是编译代码作为Windows中的其他exe文件。但是,它只是使用Python运行包的指令。

© www.soinside.com 2019 - 2024. All rights reserved.