![]() ![]() This simple trick should solve the problem. Pressing F5 you can now debug your code without problem.įigure 4: Debugging in VSCode after installing required modules Once you installed modules using the very same version chosen as interpreter in VSCode, you are ready to go. Once you realize this, solution is straightforward, just install module with pip using the same version of Python chosen as interpreter (Figure 2) using directly python.exe correct version as shown in Figure 3.įigure 3: Install modules with right version of pip IDE/Development Tools: IDE, VSCode DevOps Tools, GitHub 3. Since Visual Studio Code can use whichever version of Python in your system, you need to install modules for that specific version used. 2 Identified Problems A lot of research and paperwork has been carried out in the visual. ![]() This allows you to choose which Python version you want to use, but clearly, when you press F5 that specific version is used and probably you did not install required module in that specific version. When you edit Python files in Visual Studio Code you should select interpreter path command to specify which version of Python you want to use, as showed in Figure 2: venv2 under the folder2, the same step 2 and 3, and then I selected the interpreter under the virtual environment. The Python for Visual Studio Code extension allows VSC to connect to Python distributions installed on your computer. The problem arise because Visual Studio Code is not using the very same installation of python you are using from your command line / terminal. For example, I created a virtual environment. One of the most annoying problem is receiving a no module named xxx error when you already installed that module with pip.įigure 1: No module error when running Python code in Visual Studio Code In its 2023 survey, Stack Overflow noted that Python placed first for respondents who were either not professional developers or were learning to code.I’m not a Python expert, but I used it more often these days and I use Visual Studio Code with Python extension to author my scripts. TIOBE listed it at the top of its list of languages for October 2023, ahead of C and C++, while the Stack Overflow developer survey placed the language third, behind HTML and JavaScript, but higher than SQL. Python has long been a popular language with developers.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |