NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Installing newer Python than 3.5.5 in NI-RT Linux

I've got an 8861 PXI head unit with NI-RT Linux and find myself in need of a newer version of Python than the one that ships with the latest system image (20.6 as of this message).  I tried using opkg update and opkg install python3 to get the latest, but as others have posted, that did not work. 

 

After many searches on the internet and these forums, I have successfully downloaded and compiled the latest python 3.9 from source.  This tells me that the python script, and the python library that requires python 3.6+, will run and work with that solution.  I just want to know if there is a better way to get a newer than 3.5.5 version of Python onto my controller, without compiling from source.

Message 1 of 7
(2,718 Views)

Sorry, no answer to offer here. Just chiming in on this thread because I found myself asking the same question. Maybe a bump might get more eyes on this and a response from somebody at NI...

0 Kudos
Message 2 of 7
(2,500 Views)

The good news is that I was able to download and compile python 3.9 from source on the RT controller.  I'd still like to see a newer version of python ship on the RT controllers, but it was possible to get a newer version up and running.

0 Kudos
Message 3 of 7
(2,492 Views)

To get major version bumps of packages like Python ship, we perform a full distribution update to ensure compatibility between other packages and dependencies. We are actively working on our next distribution update, which would include a newer Python version among many other updates. Here is tentatively what we are looking at: https://github.com/ni/openembedded-core/blob/nilrt/master/hardknott/meta/recipes-devtools/python/pyt.... I cannot guarantee a timeline for when the update will ship yet, but we are actively working on it.

 

In addition, we are also working to clarify a policy around our distribution updates so that customers can more easily understand which System Images include these updates.

 

We are glad to hear that some users can be successful in the meantime by compiling from source, but we also understand the desire and need in some cases to have the newer versions of these packages included.

 

NI - Staff Product Owner

Brian.D
NI Product Owner
VeriStand
0 Kudos
Message 4 of 7
(2,480 Views)

Hello JacobsCSD,

 

could you elaborate how you managed to compile python from source?

 

I am trying to install Python >=3.7 on a myRIO device with NI myRIO 17.0.

Following the instruction in the pdf from this post I installed the listed dependencies, download python 3.7 and try to build and install it, but I get this error during make install:

 

Traceback (most recent call last):
File "/home/admin/Python-3.7.0/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/admin/Python-3.7.0/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/admin/Python-3.7.0/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/home/admin/Python-3.7.0/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/home/admin/Python-3.7.0/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/home/admin/Python-3.7.0/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
Makefile:1122: recipe for target 'install' failed
make: *** [install] Error 1

 

Apparently I do not have the zlib library installed, but I am not able to install it through opkg either.

 

Thank you in advance,

Juan

0 Kudos
Message 5 of 7
(53 Views)

I'm sorry, I can't provide more information, its been a while since I did that work and I don't have notes available detailing what I had to do to get it working.

 

The good news is that newer version of NI Real Time Linux have newer versions of Python installed by default.  Unless you are stuck on the older version of NI Real Time Linux you mentioned in your post, I suggest you upgrade to the latest to get the most up to date releases of everything.

 

If you are stuck, you should be able to find a tutorial on installing zlib from source.

 

 

0 Kudos
Message 6 of 7
(33 Views)

Hello JacobsCSD,

 

Thank you for your reply.

 

I will look into the possibility of upgrading to the latest myRIO Software, thanks for the hint.

 

I tried to compile zlib from source on the device too, but for some reason I can't get it to work: configuration, make and make install are completed without any errors, but zlib is not in /usr/local/lib afterwards.

 

Best,

Juan

 

0 Kudos
Message 7 of 7
(15 Views)