I need some help about how importing external packages.
I am using Eclipse with PyDev plugin to develop Python applications, I have a workspace containing all my projects and all the libraries/package I use in them. Also the libs/packages are projects by themselves. So the filesystem structure is:
/ (the base of the workspace: c:/Dati/workspaces/PythonEclipse/
+ APyLibUty +
¦ +-- PyLibUty (this is the package I want to import)
+ MyProject +
+-- src +
+-- main.py
so I want to import PyLibUty in main.py to be correctly imported for Nuitka. I am just starting to use Nuitka, before I used PyInstaller and I am able to import the packages correctly for Python/PyDev and PyInstaller but seems that Nuitka needs something different. Until now compiling a project using Nuitka I am able to import a package only if it s inside the project that imports it (if it is a sub directory as MyProject/PyLibUty. I mean that otherwise when I ran the binary file I see that PyLibUty is unknown and missing and obviously the binary stops to run.
I hope there is a simple solution because I do not like to copy the PyLibUty package inside each project where I need it. It is a package containing most of the classes and utilities I use more frequently.
This is my bat file to build using Nuitka:
cd C:DatiworkspacesPythonEclipseJanasSchoolsWebLoginPySide2src
python -m nuitka wbbPyb2Main.py^
--standalone^
--follow-imports^
--windows-console-mode=force^
--include-package=PyLibUty^
--include-data-dir=locales=locales^
--include-data-file=config-cl.ini=config-cl.ini^
--include-data-file=Back.png=Back.png^
--include-data-file=Cancel.png=Cancel.png^
--include-data-file=Exit.png=Exit.png^
--include-data-file=Forward.png=Forward.png^
--include-data-file=Home.png=Home.png^
--include-data-file=Load.png=Load.png^
--include-data-file=Refresh.png=Refresh.png^
--include-data-file=key.ico=key.ico^
--include-data-file=key.png=key.png^
--include-package=certifi,urllib3.contrib.socks^
--enable-plugin=pyside2,pywebview,dll-files,glfw,implicit-imports^
--output-dir=distNuitka^
--output-file=jswl.exe
copy .libslibEGL.dll .distNuitkawbbPyb2Main.dist
copy .libslibGLESv2.dll .distNuitkawbbPyb2Main.dist
copy .libsopengl32sw.dll .distNuitkawbbPyb2Main.dist
cd ..bat
It works if PyLibUty is inside the src directory where is saved wbbPyb2Main.py
it works and does not need to add a path using sys.path.add(..)