Error: ModuleNotFoundError: No module named 'xlwt'

Viewed 1264

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

enter image description here

Should I modify something in VSCode?

Could any one help to handle this issue?

TIA

1 Answers

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

Related