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

pkg_resources.DistributionNotFound: The 'ruamel_yaml' distribution was not found and is required by anaconda-project #364

Open
mforbes opened this issue Feb 6, 2022 · 1 comment · May be fixed by #399
Labels
TRIAGE Uncategorized issue

Comments

@mforbes
Copy link

mforbes commented Feb 6, 2022

When using an editable install, pip install -e anaconda-project, running anaconda-project give the error:

pkg_resources.DistributionNotFound: The 'ruamel_yaml' distribution was not found and is required by anaconda-project

I don't understand all the details -- removing the following from the bin/anaconda-project entrypoint fixes it for example:

# for compatibility with easy_install; see #2198
__requires__ = 'anaconda-project'

however, it is probably related to the name on PyPI ruamel.yaml not ruamel_yaml.

Here is how I found this:

git clone https://github.com/Anaconda-Platform/anaconda-project.git
conda create -n ap3.8 python=3.8 pip
conda activate ap3.8
python -m pip install --no-cache-dir -e anaconda-project
anaconda-project --help
Full output
(ap3.8) $ anaconda-project --help
Traceback (most recent call last):
  File ".../.conda/envs/ap3.8/bin/anaconda-project", line 33, in <module>
    sys.exit(load_entry_point('anaconda-project', 'console_scripts', 'anaconda-project')())
  File ".../.conda/envs/ap3.8/bin/anaconda-project", line 25, in importlib_load_entry_point
    return next(matches).load()
  File ".../.conda/envs/ap3.8/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File ".../.conda/envs/ap3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File ".../anaconda-project/anaconda_project/cli.py", line 13, in <module>
    import anaconda_project.internal.cli.main as cli_main
  File ".../anaconda-project/anaconda_project/internal/cli/main.py", line 16, in <module>
    from anaconda_project.internal.cli.prepare_with_mode import (UI_MODE_TEXT_ASK_QUESTIONS,
  File ".../anaconda-project/anaconda_project/internal/cli/prepare_with_mode.py", line 12, in <module>
    from anaconda_project import project_ops
  File ".../anaconda-project/anaconda_project/project_ops.py", line 20, in <module>
    from anaconda_project.project import Project, ALL_COMMAND_TYPES
  File ".../anaconda-project/anaconda_project/project.py", line 26, in <module>
    from anaconda_project.archiver import _list_relative_paths_for_unignored_project_files
  File ".../anaconda-project/anaconda_project/archiver.py", line 23, in <module>
    from conda_pack._progress import progressbar
  File ".../.conda/envs/ap3.8/lib/python3.8/site-packages/conda_pack/__init__.py", line 3, in <module>
    from .core import CondaEnv, File, CondaPackException, pack
  File ".../.conda/envs/ap3.8/lib/python3.8/site-packages/conda_pack/core.py", line 6, in <module>
    import pkg_resources
  File ".../.conda/envs/ap3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File ".../.conda/envs/ap3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File ".../.conda/envs/ap3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File ".../.conda/envs/ap3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 568, in _build_master
    ws.require(__requires__)
  File ".../.conda/envs/ap3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File ".../.conda/envs/ap3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'ruamel_yaml' distribution was not found and is required by anaconda-project
git clone https://github.com/Anaconda-Platform/anaconda-project.git
for py in 3.6 3.7 3.8 3.9; do
  env="ap${py}"
  conda create -yn "${env}" "python=${py}" pip
  conda activate "${env}"
  python -m pip install -e anaconda-project
  anaconda-project --help
done

Changing ruamel_yaml to ruamel.yaml in setup.py fixes this issue for python 3.6 through 3.10. (2.7 complains about from tempfile import TemporaryDirectory in project_ops.py: ImportError: cannot import name TemporaryDirectory)

@mforbes mforbes added the TRIAGE Uncategorized issue label Feb 6, 2022
mforbes pushed a commit to mforbes/anaconda-project that referenced this issue Feb 6, 2022
@AlbertDeFusco
Copy link
Collaborator

This started happening to me recently. I wonder if some new version of ruamel_yaml or pip has caused this. I got around it so far by dropping -e, but that's not great

@mbargull mbargull linked a pull request Oct 31, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TRIAGE Uncategorized issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants