简体   繁体   中英

Error: ModuleNotFoundError: No module named 'xlwt'

I have installed the relevant package.

The ".py" can run successfully when using IDLE. However, when I try to run it in VSCode. It trigger the error ModuleNotFoundError: No module named 'xlwt' .

在此处输入图像描述

Should I modify something in VSCode?

Could any one help to handle this issue?

TIA

It's because your pip installs to C:\users[...] and you try to use python from D:\Python - which i believe is different environement.

You can change environment in VSCode by pressing Ctrl + Shift + P , write Python and select Python: Select interpreter .

The other solution is to install these libs into D:\python by: D:/Python/python.exe -m pip install <pack> .

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