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

ModuleNotFoundError when installing via install_from_url() #66

Open
gbayarri opened this issue May 10, 2024 · 0 comments
Open

ModuleNotFoundError when installing via install_from_url() #66

gbayarri opened this issue May 10, 2024 · 0 comments

Comments

@gbayarri
Copy link

Hi, I'm installing a condacolab via install_from_url() because I need a conda/mamba with python 3.9 while colab is pinned to 3.10. I tried with several versions of mambaforge, included some of the official website or this:

https://github.com/jaimergp/miniforge/releases/tag/22.11.1-4_colab

I've tried as well with the conda constructor following the instruction of the condacolab pypi but modifying the version to 3.9:

name: condacolab  # you can edit this if you want
version: 0.1      # increment if you change the specs, for reproducibility!

channels:
  - conda-forge
specs:
  - python =3.9  # Python MUST be version 3.7
  - pip
  - conda
  - mamba  # mamba is not needed but recommended

# Pip dependencies are NOT recommended. If you do need them
# uncomment the line below and edit `pip-dependencies.sh`.
# post_install: pip-dependencies.sh

# do not edit below this line
# ---------------------------
installer_type: sh

After running all these installations, I load my environment.yml and the conda list shows the correct version of my dependencies. For example:

!conda list | grep ngl
nglview                   3.0.8              pyh1da8cd4_0    conda-forge

But when doing the import in a cell:

import nglview
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-12-dd30d89a3198>](https://localhost:8080/#) in <cell line: 1>()
----> 1 import nglview

ModuleNotFoundError: No module named 'nglview'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

The weirdest thing is that when I import this dependency in pure python it works:

!python
Python 3.9.19 | packaged by conda-forge | (main, Mar 20 2024, 12:50:21) 
[GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nglview
>>> nglview.demo()
NGLWidget()

Any idea of what I'm missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant