我正在嘗試使用WMI。我需要安裝我所做的pywin32。但是當我導入WMI時,它會返回一個錯誤。誰能幫我!Pywin32 FileNotFoundError:[Errno 2]沒有這樣的文件或目錄:... \ __ init__.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Anaconda\lib\site-packages\wmi.py", line 88, in <module>
from win32com.client import GetObject, Dispatch
File "C:\Anaconda\lib\site-packages\win32com\client\__init__.py", line 11, in <module>
from . import gencache
File "C:\Anaconda\lib\site-packages\win32com\client\gencache.py", line 666, in <module>
__init__()
File "C:\Anaconda\lib\site-packages\win32com\client\gencache.py", line 62, in __init__
Rebuild()
File "C:\Anaconda\lib\site-packages\win32com\client\gencache.py", line 653, in Rebuild
_SaveDicts()
File "C:\Anaconda\lib\site-packages\win32com\client\gencache.py", line 69, in _SaveDicts
f = open(os.path.join(GetGeneratePath(), "dicts.dat"), "wb")
File "C:\Anaconda\lib\site-packages\win32com\client\gencache.py", line 145, in GetGeneratePath
f = open(fname,"w")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\KEVINE~1\\AppData\\Local\\Temp\\gen_py\\3.6\\__init__.py'
歡迎光臨!你是否以管理員組的成員身份運行代碼? – wp78de
[無法導入WMI Python模塊]的可能重複(https://stackoverflow.com/questions/20654047/cant-import-wmi-python-module) – wp78de