building python 3.9.1 on jetpack 4.5 and the jetson xavier nx

These instructions will help you build Python 3.9.1 on the Jetson Xavier NX Development Kit running JetPack 4.5. There are two broad stages to building this version. The first is the installation of support developer libraries to allow all Python modules to successfully build, especially _ssl. If _ssl fails to build then pip will not be able to negotiate connectivity with any Python repo, making installation of modules fail. After the installation stage come the build steps.

Install Build Prerequisites

To build all Python modules the following libraries need to be installed. Simply copy-and-paste the following line:

sudo apt install zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev

Build Python

Download the latest version of Python, build, and install:

  1. Download the latest Python, version 3.9.1, from https://www.python.org/downloads/.
  2. Untar the file (we’ll assume it’s downloaded to the default ~/Downloads):
    tar xvf Downloads/Python-3.9.1.tar.xz
  3. Make a build directory at the same level as the untarred source directory. In my case I named the build directory build-python-3.9.1
  4. Change directory into the build directory.
  5. From within the build directory execute the configure script:
    ../Python-3.9.1/configure --enable-optimizations
  6. Run make with all active cores:
    make -j $(nproc)

    On my machine I enabled all six cores of the Jetson Xavier NX. Running with fewer cores will result in a longer build time.

  7. Install into the alternate location for this version of Python:
    sudo -H make altinstall
  8. Check for the alternate location with which python3.9. It should return /usr/local/bin/python3.9.

I created a Python 3.9.1 virtual work environment, something I highly recommend. I do that to keep the stock and newly installed environments distinct from one another. These are the specific steps I used to create that virtual Python environment.

  1. In your home directory create a work folder. On my system I named it ‘vpython’. Change directory (cd) into it.
  2. Then create a Python VE:
    python3.9 -m venv 39
  3. While you’re there you might as well update pip. Always count on the pip bundled with any version to be out of date with the official version. Using my environment as an example:
    $HOME/vpython/39/bin/python3.9 -m pip install --upgrade pip

Now you’re ready to use the latest Python.

Install PyQt5

I use Python library PyQt5. In order to do that you must install Ubuntu’s Qt5 support libraries as well as the Python module.

  1. Install Ubuntu Qt5 support: sudo apt install qt5-default
  2. Enable Python 3.9 virtual environment: source $HOME/vpython/39/bin/activate
  3. Install Python PyQt5: pip install PyQt5

You’re pretty much free to use Python 3.9 with PyQt5 at this point.

Note that these directions also apply to installation on the Jetson Nano on the same Jetpack version.

building liteide x37.1 on jetpack 4.4 developer preview

I managed to build LiteIDE X37.1 from the GitHub sources by following the projects clear, simple directions. They were:

$ git clone https://github.com/visualfc/liteide.git
$ cd liteide/build
$ ./update_pkg.sh
$ ./build_linux_qt4.sh

## Run it. While within the build folder from above: ##
$ cd liteide/bin
$ ./liteide

They are part of the website’s installation directions. The website is here: http://liteide.org/

The directions were written for Ubuntu 16.04, but they work just as well for Ubuntu 18.04. It should be noted that Qt5 doesn’t need to be installed. Just start with the git clone of the source and go from there. I’m running it out of where it was built. I haven’t run the installation and for my uses I don’t intend to.

For the record I have the latest version of Go, 1.14.3 for linux-arm64 (ARMv8).

This isn’t the first time I’ve built this tool. I built an earlier version under Raspbian Buster on the Raspberry Pi 4. It built and worked fine there, too.

As for usefulness, it is quite useful, at least for my purposes. In the example above it found all my files under the default GOPATH (go env GOPATH) and I was able to quickly navigate to my work and open one of my files I developed on the Raspberry Pi. It’s my hope to build and attempt to run the software and Adafruit hardware I used on the Raspberry Pi.

Right now I’m in the process of fulfilling a promise I made to my wife to clean out a good portion of our house and begin to do some home improvements. I’ve accrued a lot of “homeowner dept” that I need to pay down quite a bit. I’m retired and back to living in the regular world. These little reports will be short and sweet, and perhaps infrequent. But I won’t mind. I do all of this because I enjoy it, when I feel like it. Not because I have to. And that’s alright.