从Pexpect运行安装的软件包



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

Traceback (most recent call last):
  File "c:UserselephantAppDataLocalProgramsPythonPython37-32Scriptspyocd-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:Projectsrunnermytestvenvlibsite-packagessetuptools-39.1.0-py3.7.eggpkg_resources__init__.py", line 3086, in <module>
  File "C:Projectsrunnermytestvenvlibsite-packagessetuptools-39.1.0-py3.7.eggpkg_resources__init__.py", line 3070, in _call_aside
  File "C:Projectsrunnermytestvenvlibsite-packagessetuptools-39.1.0-py3.7.eggpkg_resources__init__.py", line 3099, in _initialize_master_working_set
  File "C:Projectsrunnermytestvenvlibsite-packagessetuptools-39.1.0-py3.7.eggpkg_resources__init__.py", line 574, in _build_master
  File "C:Projectsrunnermytestvenvlibsite-packagessetuptools-39.1.0-py3.7.eggpkg_resources__init__.py", line 892, in require
  File "C:Projectsrunnermytestvenvlibsite-packagessetuptools-39.1.0-py3.7.eggpkg_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

请帮助了解什么是错误的以及为什么从命令行工作?

问题是我试图产生pyocd.exe,而pexpect无法找到包裹。我将行更改为python -m pyocd,它的工作正常。我是Python的新手,错误地认为EXE是Windows中的其他EXE文件。但是,这只是使用Python运行软件包的指令。

相关内容

  • 没有找到相关文章

最新更新