简体   繁体   中英

after generated .exe using pyinstaller it give me error (no module named exchangelib)

I am writing python code to fetch inbox mails using credentials and I am using exchangelib and importing some modules but when I generate.exe file using pyinstaller it give me this error after run the.exe file (ModuleNotFoundError: No module named 'exchangelib')

I tried to solve it by change hidden imports in.spec file but it failed.

here is my impot libraries

from exchangelib import Account , Credentials , Configuration
from exchangelib.protocol import BaseProtocol, NoVerifyHTTPAdapter

OK Guys I figured it out: first explicitly import libraary before from in.py: then generate EXE by this line: (pyinstaller.exe --onefile -w script_name.py) but write it in the terminal in Pycharm not in command window in the project folder.. here is my impot libraries:

import exchangelib from exchangelib 
import Account , Credentials , Configuration from exchangelib.protocol 
import BaseProtocol, NoVerifyHTTPAdapter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM