ERROR: Cannot uninstall 'entrypoints'. 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. CondaEnvException: Pip failed

I can run my application fine on my dev machine, but when I go to deploy it on streamlit, I get this error:

ERROR: Cannot uninstall 'entrypoints'. 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.

Here is a link to my repo:

Thanks in advance for any help,
Ben

I managed to resolve this problem by switching my environment manager for this project from conda to pip. There may be another way to resolve this, but I wasn’t able to figure it out.

Thanks,
Ben

Welcome to the community @benjlis, glad you figured out a workaround!

Another possibility to try would be to remove all the unnecessary packages from the requirements.txt and see if it solves properly. If you just specify the packages you are importing and let conda install whatever versions, it’s possible that will work as well while still letting your app work correctly.

Best,
Randy

Thanks for the suggestion, Randy.

Some additional detail: I was originally using conda, and I simplified my environment.yml to the bare minimum. The deployment errored on installing the stream-aggrid module, which is not yet available for installation via ‘conda install.’ Conda needs to install pip to install stream-aggrid. This worked fine on my machine, but it was this step that caused the deployment error.

It was not difficult to switch everything to pip, and that resolved the problem!

Best,
Ben

1 Like

I experienced the same issue, but I couldn’t move away from Conda. It seems like the root cause is that specifying an environment.yml file doesn’t set up an isolated Conda environment as expected. Instead, it looks like packages from the environment.yml are added to an existing environment.

For the record, I managed to work around the issue by:

  • Removing the name: field from my environment.yml
  • Removing requirements like Jupyter from my environment.yml

This isn’t ideal, as I ended up creating two environment files: One for deployment and one for development (where I use Jupyter, for example). This behaviour is also quite confusing and hard to debug, as the deployed Conda environment differs from my local Conda environment.

@randyzwitch can you please verify that I got this right? In any case, it’s worth documenting the behaviour, though the ideal solution would be for conda env create to yield the same results locally and when deployed.

Thank you! :slight_smile: