B4J Question Pybridge configuration

Arf

Well-Known Member
Licensed User
Longtime User
Hi,
I'm trying to run the B4J BLE example but the Python process fails. I have not really used Python before so probably just some configuration issue.
Output is:

B4X:
Server is listening on port: 63641
Python package copied to: C:\Users\MainUser\AppData\Roaming\pybridge\b4x_bridge_1.00.zip
Python path: C:\Program Files\Anywhere Software\B4J\libraries\Python\python\python.exe
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
Python path configuration:
PYTHONHOME = 'C:\csvn\Python25\'
PYTHONPATH = 'C:\Users\MainUser\AppData\Roaming\pybridge\b4x_bridge_1.00.zip'
program name = 'C:\Program Files\Anywhere Software\B4J\libraries\Python\python\python.exe'
isolated = 0
environment = 1
user site = 1
safe_path = 0
import site = 1
is in build tree = 0
stdlib dir = 'C:\csvn\Python25\Lib'
sys._base_executable = 'C:\\Program Files\\Anywhere Software\\B4J\\libraries\\Python\\python\\python.exe'
sys.base_prefix = 'C:\\csvn\\Python25\\'
sys.base_exec_prefix = 'C:\\csvn\\Python25\\'
sys.platlibdir = 'DLLs'
sys.executable = 'C:\\Program Files\\Anywhere Software\\B4J\\libraries\\Python\\python\\python.exe'
sys.prefix = 'C:\\csvn\\Python25\\'
sys.exec_prefix = 'C:\\csvn\\Python25\\'
sys.path = [
'C:\\Users\\MainUser\\AppData\\Roaming\\pybridge\\b4x_bridge_1.00.zip',
'C:\\Program Files\\Anywhere Software\\B4J\\libraries\\Python\\python\\python312.zip',
'C:\\csvn\\Python25\\DLLs',
'C:\\csvn\\Python25\\Lib',
'C:\\Program Files\\Anywhere Software\\B4J\\libraries\\Python\\python',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
File "C:\csvn\Python25\Lib\encodings\__init__.py", line 123
raise CodecRegistryError,\
^
SyntaxError: invalid syntax
Current thread 0x0000adf4 (most recent call first):
<no Python frame>
Process completed. ExitCode: 1
Failed to start Python process.

Any tips appreciated.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You are not using the correct Python version.

Ctrl click on this line at the top of B4XMainPage: 'Create a local Python runtime: ide://run?File=%WINDIR%\System32\Robocopy.exe&args=%B4X%\libraries\Python&args=Python&args=/E
And then install the required packages by clicking on: 'Open local Python shell: ide://run?File=%PROJECT%\Objects\Python\WinPython+Command+Prompt.exe

And start with a simpler example of PyBridge.
 
  • Like
Reactions: Arf
Upvote 0
Top