python - 为什么 python 脚本在没有明确说明 cmd 中的“python”的情况下找不到这个模块?
问题描述
有人可以解释为什么 python 在脚本之前没有明确输入 python 就找不到模块吗?我已经在我的路径中包含了 python,并且我的印象是,如果环境可以用 python 解释脚本命令/执行(给出 Traceback),那么它应该与明确说明 python 没有什么不同?
该模块已安装(由 pip w/pywin32 和 pypiwin32 验证)。
>makereport.py --h
Traceback (most recent call last):
File "C:\Users\xbbld7i\Documents\ISD\EH\makereport.py", line 9, in <module>
import win32com.client
ModuleNotFoundError: No module named 'win32com'
>python makereport.py --h
usage: makereport.py [-h] [-r REPORT] issues [issues ...]
positional arguments:
issues A list of the issues - omit commas.
optional arguments:
-h, --help show this help message and exit
-r REPORT, --report REPORT
The absolute path to the report to save -or- the
relative path from the current working directory.
解决方案
推荐阅读
- r - 我在 r 中的 for 循环代码中找不到错误
- c# - 我需要排除 USB 网络
- c# - C# - WPF 如何获取对象层级别
- javascript - css/JavaScript 调整 div 内容的大小以适应窗口
- python - 在已有数据的一侧创建一个滚动条
- ios - Callkit WebRTC - 即使在呼叫者断开呼叫 Swift 之后,Callkit UI 也会显示为原样
- javascript - 无法将 API 数据从 fetch 分配给函数中的变量
- php - 如何解决PHP中for循环准备的输入和标签的索引问题?
- docker - 集群化 Dockerised ElasticSearch 节点
- javascript - Next.js 不应该将页面构建为 SSG