为什么没有显式声明cmd中的“ python”,python脚本无法找到此模块?

时间:2018-06-19 14:00:08

标签: python module

有人可以解释为什么在未在脚本之前显式键入python的情况下python无法找到模块吗?我已经在路径中包含了python,并且给人的印象是,如果环境可以使用python解释脚本命令/执行(给出Traceback),那么它应该与显式声明python没什么不同?

模块已安装(已通过pywin32和pypiwin32的pip验证)。

>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.

0 个答案:

没有答案