Jun-24-2020, 07:48 PM
Hi,
I have a python file called ImportingModules.py
I have saved this file purposely on my desktop because I want to see how you can add an Environmental Variable called PYTHONPATH and set this equal to the path where ImportingModules.py is saved (The path is C:\Users\mp88_\OneDrive\Desktop). Then I want to import this file in another module.
When i try doing this using this one line code:
I am using Windows 10 Home and executing the code using Visual Studio 2019.
Why am I getting this error?
Thank You
I have a python file called ImportingModules.py
I have saved this file purposely on my desktop because I want to see how you can add an Environmental Variable called PYTHONPATH and set this equal to the path where ImportingModules.py is saved (The path is C:\Users\mp88_\OneDrive\Desktop). Then I want to import this file in another module.
When i try doing this using this one line code:
import ImportingModules.pyI get an error saying "No module named ImportingModules"
I am using Windows 10 Home and executing the code using Visual Studio 2019.
Why am I getting this error?
Thank You