+ 1
I need help... I've been trying to create a module and import it on python with virtual studio but i keep getting error message.
5 Respuestas
+ 3
I get that you're frustrated. Trust me, I've been there. but that's not very helpful 😜
Where is your module? is it in a subdirectory of your project or is it external?
If it's in your project, you need to import it from a package relative to the script being run
so if your project structure looks like this:
main.py - the program entry point
/my_package
my_module.py
you need to import like:
import my_package.my_module
if your module is external to your project, you'll need to put it in a directory that pythons environment can access. (known as PYTHONPATH)
The method of adding a directory to PYTHONPATH is OS specific but the quickest solution is to do:
import sys
sys.path.insert(0, "path/to/module/directory")
import your_module
+ 3
what's the error message?
+ 3
If I helped you solve your problem, would you kindly accept my answer. otherwise, im sorry if I was no help
+ 1
Intellisense couldn't find d module... Blah blah blah..
0
Wow.. Thanks