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:
- 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/
) - It tried to uninstall the apt version, but failed
- 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).