Build errors when using fully pinned requirements.txt coming from pip-tools

When building https://github.com/astrojuanlu/ie-mbd-advanced-python/, build fails at this step:

Attempting uninstall terminado
Found existing installation: terminado 0.8.3
ERROR: Cannot unintstall 'terminado'. It is a distutils installed project and thus...

(by the way, I can’t seem to be able to copy the text from the build logs…)

The requirements.txt contains these lines:

$ grep terminado requirements.txt 
ptyprocess==0.6.0         # via pexpect, terminado
terminado==0.9.1          # via notebook
tornado==6.1              # via ipykernel, jupyter-client, notebook, terminado

Because they come from pip-compile:

$ cat requirements.in 
black==20.8b1
notebook
rise

I guess that pinning terminado to the version that Binder uses would fix the problem, but I don’t think this was needed in the past.


This was already discussed in the chat, this was @betatim answer (thanks!):

Generally we recommend to not list all packages ever in your requirements.txt but only those you “care” about. in particular for things which are dependencies of your dependencies and such i wouldn’t specify an explicit version

it is a bit particular to binder. i think in general having a “fully pinned” requirements.txt is a good idea/practice but in binder it gets used “on top of” an existing environment so the recommendation changes a bit

However, @minrk notes:

I think there is an issue in that the “distutils installed” bit shouldn’t happen. This is probably a problem in the conda package not installing the right metadata.

For the moment, I think I will stick to “do not pip-compile Jupyter-related dependencies” rule, or not use pip-tools at all (sadly)

2 Likes