Skip to content

Instantly share code, notes, and snippets.

@bennuttall
Last active May 11, 2020 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennuttall/6602e53f98fb62b8b8a9fb27a2d74ca8 to your computer and use it in GitHub Desktop.
Save bennuttall/6602e53f98fb62b8b8a9fb27a2d74ca8 to your computer and use it in GitHub Desktop.

Installing some pip packages globally, on a Raspberry Pi that's netbooted. Its root filesystem is on an NFS share.

root@piwheels20:# pip3 install pypandoc versioneer kervi scikit-build cython

Packages are collected and prepared for installation, and then it errors while trying to uninstall the system-installed cryptography:

...
  Downloading https://www.piwheels.org/simple/spidev/spidev-3.4-cp37-cp37m-linux_armv7l.whl (39 kB)
Installing collected packages: pypandoc, versioneer, inputs, psutil, kervi-hal-win, txaio, cryptography, autobahn, adafruit-pureio, spidev, Adafruit-GPIO, kervi-hal-rpi, kervi-device-library, pint, kervi-core, pyzmq, kervi-cli, kervi-hal-generic, kervi-ui, kervi, distro, scikit-build, cython
  Attempting uninstall: cryptography
    Found existing installation: cryptography 2.6.1
    Uninstalling cryptography-2.6.1:
      Successfully uninstalled cryptography-2.6.1
ERROR: Could not install packages due to an EnvironmentError: [Errno 16] Device or resource busy: '.nfs000000000002630200000c20'

When you run pip3 freeze it outputs successfully, as expected, but also an error comes out:

root@piwheels20:~# pip3 freeze > /dev/null
WARNING: Could not generate requirement for distribution -ryptography 2.6.1 (/usr/lib/python3/dist-packages): Parse error at "'-ryptogr'": Expected W:(abcd...)

Looking for the cause of this, I see some ~ryptography files now exist in /usr/lib/python3/dist-packages:

root@piwheels20:/usr/lib/python3/dist-packages# ls | grep "~"
~ryptography
~ryptography-2.6.1.egg-info

It looks like:

  1. It successfully installed a newer version of cryptography (2.9.2) into /usr/local/lib/python3/dist-packages/ than the version (2.6.1) that was installed by apt (in /usr/lib/python3/dist-packages/)
  2. It tried to uninstall the apt version, but failed
  3. Something happened with the NFS resource it was trying to access?

More fun: trying to reproduce this, sometimes pyzmq fails, rather than crytography (for a similar reason, it's installed by apt, but the error is that it's a distutils project so can't uninstall).

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pypandoc
Downloading https://www.piwheels.org/simple/pypandoc/pypandoc-1.5-py3-none-any.whl (21 kB)
Collecting versioneer
Downloading versioneer-0.18-py2.py3-none-any.whl (34 kB)
Collecting kervi
Downloading https://www.piwheels.org/simple/kervi/kervi-0.21.5-py3-none-any.whl (1.4 MB)
Collecting scikit-build
Downloading scikit_build-0.11.1-py2.py3-none-any.whl (72 kB)
Collecting cython
Downloading https://www.piwheels.org/simple/cython/Cython-0.29.17-cp37-cp37m-linux_armv7l.whl (4.8 MB)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from pypandoc) (46.2.0)
Requirement already satisfied: pip>=8.1.0 in /usr/local/lib/python3.7/dist-packages (from pypandoc) (20.1)
Requirement already satisfied: wheel>=0.25.0 in /usr/lib/python3/dist-packages (from pypandoc) (0.32.3)
Collecting kervi-cli==0.21.05
Downloading https://www.piwheels.org/simple/kervi-cli/kervi_cli-0.21.5-py3-none-any.whl (15 kB)
Requirement already satisfied: pillow in /usr/lib/python3/dist-packages (from kervi) (5.4.1)
Collecting kervi-hal-win==0.21.05
Downloading https://www.piwheels.org/simple/kervi-hal-win/kervi_hal_win-0.21.5-py3-none-any.whl (7.2 kB)
Collecting kervi-ui==0.21.05
Downloading https://www.piwheels.org/simple/kervi-ui/kervi_ui-0.21.5-py3-none-any.whl (3.8 MB)
Collecting pyzmq>=18.1.0
Downloading https://www.piwheels.org/simple/pyzmq/pyzmq-19.0.0-cp37-cp37m-linux_armv7l.whl (6.3 MB)
Collecting kervi-hal-rpi==0.21.05
Downloading https://www.piwheels.org/simple/kervi-hal-rpi/kervi_hal_rpi-0.21.5-py3-none-any.whl (9.2 kB)
Collecting kervi-core==0.21.05
Downloading https://www.piwheels.org/simple/kervi-core/kervi_core-0.21.5-py3-none-any.whl (61 kB)
Collecting autobahn
Downloading autobahn-20.4.3-py2.py3-none-any.whl (1.1 MB)
Collecting kervi-device-library==0.21.05
Downloading https://www.piwheels.org/simple/kervi-device-library/kervi_device_library-0.21.5-py3-none-any.whl (51 kB)
Collecting kervi-hal-generic==0.21.05
Downloading https://www.piwheels.org/simple/kervi-hal-generic/kervi_hal_generic-0.21.5-py3-none-any.whl (4.1 kB)
Collecting distro
Downloading distro-1.5.0-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: packaging in /usr/lib/python3/dist-packages (from scikit-build) (19.0)
Requirement already satisfied: Click in /usr/lib/python3/dist-packages (from kervi-cli==0.21.05->kervi) (7.0)
Collecting psutil
Downloading https://www.piwheels.org/simple/psutil/psutil-5.7.0-cp37-cp37m-linux_armv7l.whl (281 kB)
Collecting inputs
Downloading inputs-0.5-py2.py3-none-any.whl (33 kB)
Collecting Adafruit-GPIO
Downloading https://www.piwheels.org/simple/adafruit-gpio/Adafruit_GPIO-1.0.3-py3-none-any.whl (38 kB)
Collecting pint
Downloading Pint-0.11-py2.py3-none-any.whl (186 kB)
Collecting txaio>=20.3.1
Downloading txaio-20.4.1-py2.py3-none-any.whl (30 kB)
Collecting cryptography>=2.7
Downloading https://www.piwheels.org/simple/cryptography/cryptography-2.9.2-cp37-cp37m-linux_armv7l.whl (854 kB)
Collecting spidev
Downloading https://www.piwheels.org/simple/spidev/spidev-3.4-cp37-cp37m-linux_armv7l.whl (39 kB)
Collecting adafruit-pureio
Downloading https://www.piwheels.org/simple/adafruit-pureio/Adafruit_PureIO-1.1.5-py3-none-any.whl (12 kB)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python3/dist-packages (from cryptography>=2.7->autobahn->kervi) (1.12.0)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/lib/python3/dist-packages (from cryptography>=2.7->autobahn->kervi) (1.12.2)
Installing collected packages: pypandoc, versioneer, psutil, kervi-cli, inputs, kervi-hal-win, kervi-ui, pyzmq, spidev, adafruit-pureio, Adafruit-GPIO, kervi-hal-rpi, pint, kervi-core, txaio, cryptography, autobahn, kervi-device-library, kervi-hal-generic, kervi, distro, scikit-build, cython
Attempting uninstall: pyzmq
Found existing installation: pyzmq 17.1.2
ERROR: Cannot uninstall 'pyzmq'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://www.piwheels.org/simple
Collecting pypandoc
Using cached https://www.piwheels.org/simple/pypandoc/pypandoc-1.5-py3-none-any.whl (21 kB)
Collecting versioneer
Using cached versioneer-0.18-py2.py3-none-any.whl (34 kB)
Collecting kervi
Using cached https://www.piwheels.org/simple/kervi/kervi-0.21.5-py3-none-any.whl (1.4 MB)
Collecting scikit-build
Using cached scikit_build-0.11.1-py2.py3-none-any.whl (72 kB)
Collecting cython
Using cached https://www.piwheels.org/simple/cython/Cython-0.29.17-cp37-cp37m-linux_armv7l.whl (4.8 MB)
Requirement already satisfied: wheel>=0.25.0 in /usr/lib/python3/dist-packages (from pypandoc) (0.32.3)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from pypandoc) (46.2.0)
Requirement already satisfied: pip>=8.1.0 in /usr/local/lib/python3.7/dist-packages (from pypandoc) (20.1)
Collecting kervi-hal-win==0.21.05
Using cached https://www.piwheels.org/simple/kervi-hal-win/kervi_hal_win-0.21.5-py3-none-any.whl (7.2 kB)
Collecting autobahn
Using cached autobahn-20.4.3-py2.py3-none-any.whl (1.1 MB)
Collecting kervi-hal-rpi==0.21.05
Using cached https://www.piwheels.org/simple/kervi-hal-rpi/kervi_hal_rpi-0.21.5-py3-none-any.whl (9.2 kB)
Collecting kervi-device-library==0.21.05
Downloading https://www.piwheels.org/simple/kervi-device-library/kervi_device_library-0.21.5-py3-none-any.whl (51 kB)
Collecting kervi-core==0.21.05
Using cached https://www.piwheels.org/simple/kervi-core/kervi_core-0.21.5-py3-none-any.whl (61 kB)
Collecting pyzmq>=18.1.0
Downloading https://www.piwheels.org/simple/pyzmq/pyzmq-19.0.0-cp37-cp37m-linux_armv7l.whl (6.3 MB)
Collecting kervi-cli==0.21.05
Using cached https://www.piwheels.org/simple/kervi-cli/kervi_cli-0.21.5-py3-none-any.whl (15 kB)
Collecting kervi-hal-generic==0.21.05
Using cached https://www.piwheels.org/simple/kervi-hal-generic/kervi_hal_generic-0.21.5-py3-none-any.whl (4.1 kB)
Requirement already satisfied: pillow in /usr/lib/python3/dist-packages (from kervi) (5.4.1)
Collecting kervi-ui==0.21.05
Using cached https://www.piwheels.org/simple/kervi-ui/kervi_ui-0.21.5-py3-none-any.whl (3.8 MB)
Collecting distro
Downloading distro-1.5.0-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: packaging in /usr/lib/python3/dist-packages (from scikit-build) (19.0)
Collecting inputs
Downloading inputs-0.5-py2.py3-none-any.whl (33 kB)
Collecting psutil
Downloading https://www.piwheels.org/simple/psutil/psutil-5.7.0-cp37-cp37m-linux_armv7l.whl (281 kB)
Collecting txaio>=20.3.1
Downloading txaio-20.4.1-py2.py3-none-any.whl (30 kB)
Collecting cryptography>=2.7
Downloading https://www.piwheels.org/simple/cryptography/cryptography-2.9.2-cp37-cp37m-linux_armv7l.whl (854 kB)
Collecting Adafruit-GPIO
Downloading https://www.piwheels.org/simple/adafruit-gpio/Adafruit_GPIO-1.0.3-py3-none-any.whl (38 kB)
Collecting pint
Downloading Pint-0.11-py2.py3-none-any.whl (186 kB)
Requirement already satisfied: Click in /usr/lib/python3/dist-packages (from kervi-cli==0.21.05->kervi) (7.0)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/lib/python3/dist-packages (from cryptography>=2.7->autobahn->kervi) (1.12.2)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python3/dist-packages (from cryptography>=2.7->autobahn->kervi) (1.12.0)
Collecting adafruit-pureio
Downloading https://www.piwheels.org/simple/adafruit-pureio/Adafruit_PureIO-1.1.5-py3-none-any.whl (12 kB)
Collecting spidev
Downloading https://www.piwheels.org/simple/spidev/spidev-3.4-cp37-cp37m-linux_armv7l.whl (39 kB)
Installing collected packages: pypandoc, versioneer, inputs, psutil, kervi-hal-win, txaio, cryptography, autobahn, adafruit-pureio, spidev, Adafruit-GPIO, kervi-hal-rpi, kervi-device-library, pint, kervi-core, pyzmq, kervi-cli, kervi-hal-generic, kervi-ui, kervi, distro, scikit-build, cython
Attempting uninstall: cryptography
Found existing installation: cryptography 2.6.1
Uninstalling cryptography-2.6.1:
Successfully uninstalled cryptography-2.6.1
ERROR: Could not install packages due to an EnvironmentError: [Errno 16] Device or resource busy: '.nfs000000000002630200000c20'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment