Problem installing numpy for python3 on fresh JetPack install

I have flashed my TX2 successfully with the latest JetPack.

When I try to install numpy for python3 (default on the TX2 is python 3.5), I run into problems. It doesn’t matter if I use apt or pip3, I suspect the underlying problem is the same.

Variation 1: Install via apt

$ sudo apt install python3-numpy
...
The following packages have unmet dependencies:
 python3-numpy : Depends: liblapack3 but it is not going to be installed or
                          liblapack.so.3
E: Unable to correct problems, you have held broken packages

If you go down the route of trying to get liblapack3 / liblapack-dev, etc., you get various dependency problems such as liblapack-dev depends on libblas-dev depends on gfortran depends on gfortran-5 depends on gcc-5, and on down the rat hole.

The following packages have unmet dependencies:
 gfortran-5 : Depends: gcc-5-base (= 5.3.1-14ubuntu2) but 5.4.0-6ubuntu1~16.04.9 is to be installed
              Depends: gcc-5 (= 5.3.1-14ubuntu2) but 5.4.0-6ubuntu1~16.04.9 is to be installed
              Depends: libgfortran-5-dev (= 5.3.1-14ubuntu2) but it is not going to be installed

Variation 2: Install via pip3

$ sudo apt install python3-pip [ok, but old version of pip.]
$ pip3 install numpy --user
...
File "numpy/core/setup.py", line 422, in generate_config_h
        moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
      File "numpy/core/setup.py", line 48, in check_types
        out = check_types(*a, **kw)
      File "numpy/core/setup.py", line 281, in check_types
        "install {0}-dev|{0}-devel.".format(python))
    SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

$ sudo apt install python3.5-dev

The following packages have unmet dependencies:
 python3.5-dev : Depends: libpython3.5-dev (= 3.5.1-10) but it is not going to be installed
                 Depends: libexpat1-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

And on down the dependency rat hole once again.

Can anyone please see if they can reproduce the problem? Is there something idiosyncratic about my jetpack install (I’ve tried re-flashing multiple times after various failed attempts to correct this issue). My next step will be to download the previous JetPack and determine whether or not this is a new problem.

Thank you
–Steve O’Hara

Hi,

We have tested the numpy installation for python3, and it can be well-installed.
Here is our steps:

sudo apt-get install python3-numpy

Please let us know if you still meet error.
Thanks.

This clearly doesn’t work for me, per my post. However, I last downloaded jetpack 2 weeks ago, and I’ve been reflashing from the same image. I wanted to try downloading the previous version of jetpack (because in the past, I’ve had no problems with this), but then I found that the links to all the archived jetpacks are broken (see another post I’ve made about this issue).

I will re-download the current jetpack and try everything from scratch again and let you know.

This is now resolved. A fresh download of JetPack 3.2 did the trick.

My problems were from a download of Jetpack 3.2 dating from April 17th. Installing from this older download (although same .run file name: JetPack-L4T-3.2-linux-x64_b196.run) resulted in the reported problem, even after repeated re-installs.

Installing the full jetpack from today’s download, and all is well.