NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

install pip for python3

I'm sorry for the vague title, but I have a couple of questions.

I am using cRIO 9030, OS NI Linux Real-Time x64 4.9.47-rt37-6.0.0f1. I have LabVIEW 2018.

 

I successfully installed python 3.5.2 using the command

opkg install python3

and I accidentally installed python 2.7.13 using the command

opkg install python-pip

 

I want to install install libraries using pip, but I could not install pip3, and now pip is tied to python 2.7.13. How do I install pip3 or connect pip to python 3? How can I upgrade python 3.5.2 to python 3.7?

 

--Edit on 2/4/2019--

So I might not need to update from 3.5 to 3.7, but I could cross compile pip for python3 to install it on the cRIO. I don't know how to do that. 

With python2.7 being obsoleted, it seems to be important to be able to install python3-pip

 

I found this discussion, and I was following tduffy's suggestion, but his first step is to uncomment a line in /etc/opkg/angstrom-base-feed.conf but that file does not exist and the closest looking file base-feeds.conf does not have the line tduffy suggests.

 

I found that there are two pieces of code that might be able to install pip. get-pip.py and ensurepip. But both are  missing modules. I have been trying to install them through opkg, but I hit wall with both saying they are missing getpass

 

I found getpass. Apparently the use it in python3-git. I found the other dependencies as well, and I did end up getting pip installed for python3

0 Kudos
Message 1 of 5
(4,813 Views)

Hi LJHerskowitz

I wish to perform an install of Python 3.6 (in order to run tensorflow) to the MyRio  LinuxRt directly from scratch. up to know i did not install any python versions. so far i just perform to connect with my device throught putty :/. which steps should i follow?

 

thanks in advance

0 Kudos
Message 2 of 5
(4,480 Views)

Hello,

 

I am also trying to install pip3 on my cRIO running the NI Linux Real-Time x64 4.14.87-rt49-cg-7.0.0f0-x64-189 (shipped with labview 2019).

I have installed python 3.5.5 using opkg install pyhton3

I have read that pip should be included by default since the version 3.4+ but apparently it is not in the version in the opkg repository,

I have tried to run python3 get-pip.py but a dependency is missing (ntpath) which is weird because it is supposed to be included in pyhton core

I have tried to run python3 -m ensurepip but I only obtained a missing module message (/usr/bin/python3: No module named ensurepip)

 

I am running out of solution so if anybody managed to make pip3 work correctly on NI Linux RT I would be glad to have any help.

Since python 2.x is almost deprecated (at the end of the year I think) it is not a solution anymore,

 

Thanks in advance

0 Kudos
Message 3 of 5
(4,297 Views)

I found a lot of packages were missing when trying to run the get-pip.py script (I got this script from https://bootstrap.pypa.io/get-pip.py if you want to replicate what I did). If you are using the systemlink base image you should only need to install python3-pydoc and python3-runpy packages from opkg but if you are starting with the more generic base image you will need a few more packages.

 

I was trying to get the Remote-SSH connection working with Visual Studio Code so not all of the following modules are technically needed for the pip install but I ended up installing "python3-<module>" for the following modules: json, logging, threading, distutils, plistlib, misc, pprint, pickle, net-server, xmlrpc, compile, and numbers. Again, only a subset of those would be strictly necessary to install pip but I honestly don't remember which. 

Matt J | National Instruments | CLA
Message 4 of 5
(4,280 Views)

Thanks a lot for your message it solves my problem.

It looks like python3-misc was the key here

0 Kudos
Message 5 of 5
(4,257 Views)