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

conda install takes a very long time #475

Open
maurerle opened this issue Oct 4, 2023 · 9 comments
Open

conda install takes a very long time #475

maurerle opened this issue Oct 4, 2023 · 9 comments
Labels
has-workaround The issue describes a valid workaround until the primary issue is solved v0.6 Version 0.6

Comments

@maurerle
Copy link

maurerle commented Oct 4, 2023

Problem description

Running conda create -c conda-forge -n calliope calliope does not finish somehow.

Running on Debian 12 with conda 23.7.4 with base python 3.10.4

Calliope version

Does not resolve somehow - creating an env and installing with pip works though

@brynpickering
Copy link
Member

Could you try it with mamba? I find it resolves packages a lot more successfully.

Also, you should try and stop the default conda channel from being included. This can slow things down as it has more channels to download and then resolve (a view recommended by mamba devs). Adding -c nodefaults should do the trick.

@maurerle
Copy link
Author

I already found a workaround by installing from pip:

conda create -n calliope pip
conda activate calliope
pip install calliope

Nodefaults was not faster either (I stopped after 5 minutes):

~ conda create -c conda-forge -c nodefaults -n calliope calliope
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): | failed

I just want to state, that the "Quickstart" instructions, weren't so quick at all ;)
which is quite weird as I am creating a new env with only one selected package...

@brynpickering
Copy link
Member

Ok, good to know RE nodefaults. Can you try with mamba? I would highly recommend it as your go-to instead of conda (and we will update our installation instructions accordingly). I also would recommend not mixing conda and pip packages where possible. It might work fine initially but then the environments can become very messy very quickly.

@brynpickering
Copy link
Member

Also, you could try forcing the python version to the highest calliope can be built with: conda create -c conda-forge -c nodefaults -n calliope calliope python=3.9 This should be done by conda by default, but maybe it helps speed things up to pin it explictly.

@maurerle
Copy link
Author

maurerle commented Oct 11, 2023

I heard promising things about mamba, but it is not available as a .deb package, and I don't feel like installing it with sudo tee :D
For my needs I more and more find pip sufficient, as it has binary packages (psycopg2-binary, pytorch and so on) as well - reducing the usefulness of conda..?
I am therefore mostly using conda as venv alternative which is globally usable

Setting the python version explicitly did not speed things up for me. How long does this command take on your computer? Maybe this could also be a problem which is only reproducible on Debian12?

EDIT: i could install it after like 10 Minutes - so it has a deterministic end at least :D

@maurerle maurerle changed the title conda install takes forever conda install takes a very long time Oct 11, 2023
@brynpickering
Copy link
Member

It takes less than a minute, but then I have most dependencies cached. It could be a Debian12 thing. I think @sjpfenninger had similar issues on a remote machine recently too, but don't know what distro he was using.

If pip works for you then I would suggest continuing with that as your workaround, but would advise keeping your conda env python version to <=3.9 to ensure you don't accidentally trip up on issues that have led to us choosing this upper limit for now.

@brynpickering brynpickering added the has-workaround The issue describes a valid workaround until the primary issue is solved label Oct 11, 2023
@tomzac19
Copy link

Also, you could try forcing the python version to the highest calliope can be built with: conda create -c conda-forge -c nodefaults -n calliope calliope python=3.9 This should be done by conda by default, but maybe it helps speed things up to pin it explictly.

I tried to install Calliope through this procedure, and it worked, as well as it worked through Mamba. Unfortunately, I encountered the same error when launching the Jupyter Notebook.
First, the Jupyter Notebook is not installed, then I installed it in the Calliope environment just created. Then, when launching it, i get the following error, as if smth got lost during the "easy way to install":

Traceback (most recent call last):
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\notebook\traittypes.py", line 235, in _resolve_classes
    klass = self._resolve_string(klass)
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\traitlets\traitlets.py", line 2025, in _resolve_string
    return import_item(string)
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\traitlets\utils\importstring.py", line 31, in import_item
    module = __import__(package, fromlist=[obj])
ModuleNotFoundError: No module named 'jupyter_server.contents'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Tommaso\anaconda3\envs\calliope\Scripts\jupyter-notebook-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\jupyter_core\application.py", line 280, in launch_instance
    super().launch_instance(argv=argv, **kwargs)
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\traitlets\config\application.py", line 1051, in launch_instance
    app = cls.instance(**kwargs)
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\traitlets\config\configurable.py", line 575, in instance
    inst = cls(*args, **kwargs)
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\traitlets\traitlets.py", line 1311, in __new__
    inst.setup_instance(*args, **kwargs)
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\traitlets\traitlets.py", line 1354, in setup_instance
    super(HasTraits, self).setup_instance(*args, **kwargs)
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\traitlets\traitlets.py", line 1330, in setup_instance
    init(self)
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\notebook\traittypes.py", line 226, in instance_init
    self._resolve_classes()
  File "C:\Users\Tommaso\anaconda3\envs\calliope\lib\site-packages\notebook\traittypes.py", line 238, in _resolve_classes
    warn(f"{klass} is not importable. Is it installed?", ImportWarning)
TypeError: warn() missing 1 required keyword-only argument: 'stacklevel'

@sjpfenninger
Copy link
Member

We can't diagnose what might be going wrong with Jupyter, but I'd try something like conda create -c conda-forge -c nodefaults -n calliope calliope jupyter notebook python=3.9 - that ought to get you an environment with a working Jupyter installation.

@tomzac19
Copy link

We can't diagnose what might be going wrong with Jupyter, but I'd try something like conda create -c conda-forge -c nodefaults -n calliope calliope jupyter notebook python=3.9 - that ought to get you an environment with a working Jupyter installation.

Magic! It worked, you were very kind. Thanks a lot!

@brynpickering brynpickering added the v0.6 Version 0.6 label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-workaround The issue describes a valid workaround until the primary issue is solved v0.6 Version 0.6
Projects
None yet
Development

No branches or pull requests

4 participants