Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using notebook %pip magic when in IPython env for check_and_install_missing_packages #183

Closed
ianhelle opened this issue Jul 14, 2021 · 1 comment
Assignees
Labels
accepted The request/issue is accepted for a fix bug Something isn't working

Comments

@ianhelle
Copy link
Contributor

In Azure ML, using pip in a subprocess or using "!pip" from the notebook causes cross-kernel problems for the conda environment.
Specifically if you !pip install a package in py36 conda environment, then switch to py38 environment you cannot either import the package, nor can you !pip install it. Pip finds the package in the py36 environment and claims it is already installed.
The package is however, not available to the py38 kernel.

Change the code in check_and_install_missing_packages to:

  • detect if running in IPython
  • use get_ipython().run_line_magic
  • run %pip install pkg
@ianhelle ianhelle self-assigned this Jul 14, 2021
@ianhelle ianhelle added accepted The request/issue is accepted for a fix bug Something isn't working labels Jul 14, 2021
@ianhelle
Copy link
Contributor Author

Apparently I already implemented this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The request/issue is accepted for a fix bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant