Can I use python3 in wp76xx module

Because I cannot run file on python3 and it get same error with python.
I have ask the wfx company they said have to fix “Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to [:<exec_prefix>]” first.
and I think it have only surface cuz’ when I press up-arrow I got “^]]A”. It should get the command before right?

does this help?

I already tried. it same result.
Screenshot from 2022-04-06 12-01-10

it sets like this:

image

Here is my testing:


root@fx30:~# python3
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 3.5.5 (default, Dec 22 2021, 17:41:21) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> exit()
root@fx30:~# pwd
/home/root
root@fx30:~# export PYTHONHOME=/usr/lib/python3.5/
root@fx30:~# export PYTHONPATH=/usr/lib/python3.5/
root@fx30:~# python3
Python 3.5.5 (default, Dec 22 2021, 17:41:21) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

still get Error while import python3 file
wfx_test_dut.py.txt (26.4 KB)

root@swi-mdm9x28-wp:~# cd wfx-common-tools/test-feature
root@swi-mdm9x28-wp:~/wfx-common-tools/test-feature# python3
Python 3.5.5 (default, Mar 31 2022, 03:43:27) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from wfx_test_dut import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/root/wfx-common-tools/test-feature/wfx_test_dut.py", line 133
    nb_text = f"{points} points: open_loop"
                                          ^
SyntaxError: invalid syntax
>>> 

no idea as I am not python expert.
Currently the python3 can be run already, so this is out of the scope.

it have a command that have to use with python version3.6 upper.
So have can I install python3 version3.6 or upper in wp76 module

I have no experience on this…

Maybe you change that command to be usable in python3.5.5 will be easier

I want to import logging to using with my code. I have found the file in “./yocto/build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/packages-split/python3-logging” and tried to copy it in to wp76 module but still cannot import.

How can I do??

>>> import logging
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'logging'

you need to do the following two commands

scp -r ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/lib/python3.5/logging/ root@192.168.2.2:/usr/lib/python3.5
scp -r ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/lib/python3.5/collections/ root@192.168.2.2:/usr/lib/python3.5
root@fx30:~# python3
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 3.5.5 (default, Dec 22 2021, 17:41:21) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>>
1 Like

how about “import argparse”?

Screenshot from 2022-04-08 09-12-57

I don’t know, seems already having the struct.py…

Just found that you can do this:
scp ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/lib/python3.5/lib-dynload/_struct.cpython-35m-arm-linux-gnueabi.so root@192.168.2.2:/usr/lib/python3.5


root@fx30:~# python3
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 3.5.5 (default, Dec 22 2021, 17:41:21) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import argparse
>>>
1 Like

“from distutils.version import StrictVersion”
still missing module please help , thank you

>>> from wfx_test_dut import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/root/wfx-common-tools/test-feature/wfx_test_dut.py", line 6, in <module>
    from wfx_test_target import *
  File "/home/root/wfx-common-tools/test-feature/wfx_test_target.py", line 15, in <module>
    from wfx_pds_tree import *
  File "/home/root/wfx-common-tools/test-feature/wfx_pds_tree.py", line 21, in <module>
    from distutils.version import StrictVersion
ImportError: No module named 'distutils'

>>> import StrictVersion
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'StrictVersion'

to import distutils:

scp -r ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/python3/3.5.5-r1.0/image/usr/lib/python3.5/distutils/ root@192.168.2.2:/usr/lib/python3.5/

no idea for StrictVersion…

1 Like