Python requirements can't build on Ubuntu 20.04

Issue #117 resolved
Joseph Parker created an issue

On a fresh Ubuntu 20.04 VM, building the python requirements in a virtual environment by doing

$ python3 -m venv pythonenv
$ . pythonenv/bin/activate
$ pip install -r requirements.txt

fails to build numpy with

[pages of output]
ERROR: Command errored out with exit status 1: /home/joseph/code/gs2/pythonenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6guyljiw/numpy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6guyljiw/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-7uf1bh1j/install-record.txt --single-version-externally-managed --compile --install-headers /home/joseph/code/gs2/pythonenv/include/site/python3.8/numpy Check the logs for full command output.

There are only three packages in requirements.txt,

numpy==1.16.6
netCDF4==1.5.3
ford==6.0.0

and we’ve pinned versions that worked on Ubuntu 16.04 (a very non-fresh install…).

Changing the numpy version to the current latest numpy==1.19.1 works, as does specifying numpy>=1.16.6. AIUI, it’s better to specify exact versions, but also, I can’t verify that 1.19.1 works on any machine except my own. What’s good practice here?

Comments (4)

  1. Peter Hill

    pip install numpy~=1.18 works in 16.04, so if it also works in 20.04 I suggest bumping to that. ~= is best practice, means “install highest compatible version”.

    It doesn’t look like 1.19.1 is available on 16.04, only goes up to 1.19.0rc1.

  2. Log in to comment