I'm trying to create an embedded python for my project.
Added them to the PTH file like so:
python37.zip. Lib Lib/site-packages Scripts include DLLs doc libs Tools tcl # Uncomment to run site.main() automatically #import site
and when I tested it, I tried to run a project with the following structure:
By running the command (using the embedded python): G:\GitHub\VRoscopy\VRoscopy\Conversion\python\python.exe main.py
I get the following error:
> Traceback (most recent call last):
> File "mymain.py", line 1, in <module>
> import folder.module as m ModuleNotFoundError: No module named 'folder'
However, when I try running the system python everything works normally.
Hope anyone can help me, thanks
The problem was solved by adding the project files to the PTH file, and uncommenting the "import site" like follows:
python37.zip . ../invesalius
../invesalius/* # <----- added this line
Lib
Lib/site-packages
Scripts
include
DLLs
doc
libs
Tools
tcl
# Uncomment to run site.main() automatically
import site
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.