I have C:\Users\user\AppData\Roaming\Python\Python37\site-packages
directory in sys.path
And while I run code via cmd it works fine.
However, when i try run it via vscode debugger, I get this:
No module named request
So, how can I fix this?
I have C:\Users\user\AppData\Roaming\Python\Python37\site-packages
directory in sys.path
And while I run code via cmd it works fine.
However, when i try run it via vscode debugger, I get this:
No module named request
So, how can I fix this?
Copyright © 2021 Jogjafile Inc.
According to your description, it is recommended that you could try the following methods:
Check the python interpreter for the current VSCode.
When running python files in the cmd window, the system uses the python set by the environment variable.
About it can run in cmd, but not in VSCode.This will happen if the Python interpreter used in VSCode is different from the cmd. Reference:python-interpreter.
Try using pip to install the required module again. Use '
pip --version
'(Linux and Mac:'pip -v
') at the terminal to check whether the version of pip comes from the current interpreter.Use 'pip install <modules name>
' to install it. Then, check whether the module is in the list by 'pip list
'.Attempt to reload VSCode.
Above, I could import the required modules from similar locations. My environment:python:3.8.3; VSCode:1.47.2; Win10.
Update:
launch.json: