Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can I get Poetry to reinstall ipykernel after installing ipywidgets?

I’m developing a Python package. I used Poetry to set up my development environment; I intend to distribute my code through PyPI. One of my dependencies requires ipywidgets<7.7.2, as documented here. Due to a bug (mentioned here), ipykernel must be reinstalled after ipywidgets is installed.

This SO answer says that developers can’t specify the order that Poetry installs packages. Is this still true? If so, what is the simplest way to get users to re-install ipykernel after installing ipywidgets?

I could add something to my documentation telling users to run pip uninstall ipykernel then pip install ipykernel. But this seems like it would trip up unwary users?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

  • Assuming you have activated Poetry virtual environment with poetry shell command

  • When you run pip install after poetry install, it unconditionally overwrites any packages installed the virtual environment

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading