I have a problem installing Python libraries. I tested both from Python Global and Python Local. The library installs successfully but I get an error when running.
https://py-pdf.github.io/fpdf2/index.html This is a console app, based on the console template: [PyBridge] Console (non-ui) project template Dependency: pip install fpdf2 'Html - html string 'img - Background image. Can be array of bytes or a string with the path to the image file. Public...
www.b4x.com
b4j log:
B4X:
(RuntimeException) java.lang.RuntimeException: (b4xmainpage._htmltopdf) - Python Error (ModuleNotFoundError) - Method: module.exec: No module named 'fpdf'
I checked all three runtimes.
1.https://github.com/adang1345/PythonWin7/tree/master/3.13.2
2.b4j internal python runtime
3.https://github.com/winpython/winpython/releases/tag/13.1.202502222final
Yes, that was exactly the problem. I had installed Python before and I didn't remember. I uninstalled it and the problem was solved. But why does this problem occur and what is the solution?
When we set the Python path in b4j, why should it depend on the Python installed on the system?
Dim opt As PyOptions = Py.CreateOptions("Python/python/python.exe")
It first searches this path (the local Python) and if not it uses the global Python which is the Python set under Tools - Configure Paths. Technically it works by getting the B4J_PYTHON environment variable which is set by the IDE.