0

I can install modules, such as the 'requests' module. However, if I try and import them, python tells me it's missing. I can use native modules such as the json module, however.

I tried to install and import third-party modules in python on visualstudio code, but I'm stuck trying to figure out how to import them.

  • I should have specified earlier: I get the "ModuleNotFoundError: No module named 'third_party_module_name_here'" error – Corey King Nov 15 '22 at 07:05
  • 3
    Most likely, either you're installing them for the wrong Python, or you're importing the wrong name. We can't tell. – user2357112 Nov 15 '22 at 07:07
  • 1
    If you are on Mac or Linux, what is the output of `which python` and `whereis python`? I guess it's probably due to the virtual env stuff that is mis-configured. – crazyoptimist Nov 15 '22 at 07:09

2 Answers2

0

the only reason I see is you are installing the modules in different path and python is not able to refer for import script. Try below for installing the module and it may help

How to use pip with Visual Studio Code

Vivs
  • 447
  • 4
  • 11
0

Thanks for you responses guys. Now that I know what the issue is, thanks to you guys, I learned about path and how to add python to path, following this guide: https://www.maketecheasier.com/what-is-the-windows-path/ I can now successfully install third party packages and have them be recognised in VSCode :)