Fixing ModuleNotFoundError

Example 1: 

While working on a project using many modules spread through out a complex folder structure (see figure 1). I got a  "ModuleNotFoundError" error saying python couldn't locate the module "jsonschema". 



VSCode had highlighted it in yellow. 


Checking that the page is installed in the activate conda environment:


I check the "Python Interpret" being used by VSCode using the command plate (crtl-shft-p):

By Default the "recommended" interpreter was slected.  I changed the value to the option labeled 'conda'



SUCCESS!


Example 2:

While working on a project using many modules spread through out a complex folder structure (see figure 1). I got a  "ModuleNotFoundError" error saying python couldn't locate the module "RedditUtils". 


Put a '.' in front of the folder name 'RedditUtils' in the line "from RedditUtils import *".

Comments

Popular posts from this blog

Passwordless SSH