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

Creating an environment with mamba raises AttributeError #9306

Closed
martinfleis opened this issue Jun 7, 2022 · 6 comments
Closed

Creating an environment with mamba raises AttributeError #9306

martinfleis opened this issue Jun 7, 2022 · 6 comments
Labels
Support Support question

Comments

@martinfleis
Copy link

Details

Expected Result

Creating and env using mamba as a solver should properly create an environment.

mamba env create --quiet --name latest --file doc/environment.yml

Actual Result

This step currently fails.

Traceback (most recent call last):
  File "/home/docs/.asdf/installs/python/mambaforge-4.10.3-10/bin/mamba", line 7, in <module>
    from mamba.mamba import main
  File "/home/docs/.asdf/installs/python/mambaforge-4.10.3-10/lib/python3.9/site-packages/mamba/mamba.py", line 49, in <module>
    from mamba import repoquery as repoquery_api
  File "/home/docs/.asdf/installs/python/mambaforge-4.10.3-10/lib/python3.9/site-packages/mamba/repoquery.py", line 12, in <module>
    def _repoquery(query_type, q, pool, fmt=api.QueryFormat.JSON):
AttributeError: module 'libmambapy' has no attribute 'QueryFormat'

Note that a couple days ago, the same step also failed but on a different error.

Traceback (most recent call last):
  File "/home/docs/.asdf/installs/python/mambaforge-4.10.3-10/bin/mamba", line 11, in <module>
    sys.exit(main())
  File "/home/docs/.asdf/installs/python/mambaforge-4.10.3-10/lib/python3.9/site-packages/mamba/mamba.py", line 882, in main
    from conda.common.compat import ensure_text_type, init_std_stream_encoding
ImportError: cannot import name 'init_std_stream_encoding' from 'conda.common.compat' (/home/docs/.asdf/installs/python/mambaforge-4.10.3-10/lib/python3.9/site-packages/conda/common/compat.py)

xref geopandas/geopandas#2455

@stsewd
Copy link
Member

stsewd commented Jun 7, 2022

Hi, from mamba-org/mamba#1370 (comment) looks like this is because we are executing conda update --yes --quiet --name=base --channel=defaults conda. Since you are using a specific version of conda at https://github.com/geopandas/geopandas/blob/4d1049b374263a2e69eabf9590d681ff316a2040/readthedocs.yml#L4-L5 I have disabled that feature for your project, and the build is passing now https://readthedocs.org/projects/geopandas/builds/17119525/.

@stsewd stsewd closed this as completed Jun 7, 2022
@stsewd stsewd added the Support Support question label Jun 7, 2022
@martinfleis
Copy link
Author

Thanks!

@Zeitsperre
Copy link

Zeitsperre commented Oct 4, 2022

@stsewd

Hi, sorry to chime in on a closed issue, but I've run into the exact same issue as mentioned/resolved here:

Build failure: https://readthedocs.org/projects/pavics-raven/builds/18248967/
Relevant RTD configuration: https://github.com/Ouranosinc/raven/blob/3e00a43e328b5ffce7f202fde595dce40b7b4f0a/.readthedocs.yml

Would it be possible to change the relevant settings for this project as well?

Thank you!

@humitos
Copy link
Member

humitos commented Oct 5, 2022

Hi @Zeitsperre! I disabled the feature UPDATE_CONDA_STARTUP on your project and this particular error disappear. However, there is another one, but doesn't look related to Read the Docs. See https://readthedocs.org/projects/pavics-raven/builds/18253009/

Encountered problems while solving:
  - nothing provides requested ravenpy >=0.8.0

@Zeitsperre
Copy link

@humitos Thanks so much, and no worries, that error is expected. All good!

@stsewd
Copy link
Member

stsewd commented Oct 6, 2022

We should probably disable this feature when users have an explicit version, or even remove it completely and ask users to migrate to the new option of the config file (build.tools)

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

No branches or pull requests

4 participants