B4J v10.2 BETA #2 is available for download.
Download link: https://www.b4x.com/b4j/files/beta.exe
The main change in this update is related to the way the Python runtime is located.
The new template is named PyBridge and it no longer includes a Python runtime. The Python package is installed under Program Files\Anywhere Software\B4J\Libraries\Python
There is now a
local Python and
global Python.
The path to the global Python can be configured with Tools - Configure Paths. If not configured then the internal Python package is considered to be the global Python.
At runtime - PyBridge looks for the local Python - the path passed to CreateOptions:
Dim opt As PyOptions = Py.CreateOptions("Python/python/python.exe")
If it doesn't exist then the global Python will be used.
There is a comment link that will create a local Python by copying the internal one to the project folder:
'Top of B4XMainPage.
'Create a local Python runtime: ide://run?File=%WINDIR%\System32\Robocopy.exe&args=%B4X%\libraries\Python&args=Python&args=/E
My recommendation:
1. Start a new PyBridge project.
2. Create a local Python runtime and copy the Python folder (Objects\Python) to a different folder.
3. Configure this Python to be the global Python.
Use the global Python will all projects.
When you are ready to distribute a project then switch to a local Python with the relevant dependencies.
Note that the internal Python is stored in a read-only folder. If you try to install libraries they will be installed in C:\Users\<user>\AppData\Roaming\Python. This is a global folder for Python libraries and it can later be difficult to understand where the library is loaded from. Therefore, it is recommended to make a copy of the Python package and use that copy as the global Python.
View attachment 161897