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

Can't install PyYAML with pip if setuptools isn't installed #444

Closed
IRDonch opened this issue Sep 24, 2020 · 8 comments
Closed

Can't install PyYAML with pip if setuptools isn't installed #444

IRDonch opened this issue Sep 24, 2020 · 8 comments

Comments

@IRDonch
Copy link

IRDonch commented Sep 24, 2020

Trying to install PyYAML using pip when setuptools isn't installed results in this:

# python3 -mpip install --user pyyaml
Collecting pyyaml
  Using cached PyYAML-5.3.1.tar.gz (269 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4gsyi4k8/pyyaml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4gsyi4k8/pyyaml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-p9iajmh9
         cwd: /tmp/pip-install-4gsyi4k8/pyyaml/
    Complete output (3 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'setuptools'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Ideally, PyYAML should include a pyproject.toml file declaring build-time dependencies, so that pip can fetch them automatically.

@FormerlyChucks
Copy link

I suppose a pyproject.toml file could be added, but why not just install setuptools?

@IRDonch
Copy link
Author

IRDonch commented Dec 2, 2020

I suppose a pyproject.toml file could be added, but why not just install setuptools?

You could say that about any dependency. 🤷 Ideally, every project should fetch all of its own dependencies automatically.

@FormerlyChucks
Copy link

Most of my projects internally rely on setuptools. Do you have an example pyproject.toml file you could show me?

@nitzmahone
Copy link
Member

The 5.4 release will include some packaging updates that start to clean up the distutils/setuptools mess, but due to the age of the Pythons/pips we still support, we can't wholesale switch to a PEP517 (pyproject.toml) build yet. Maybe in 6.0, depending on what Pythons we drop support for, but that's still TBD.

@IRDonch
Copy link
Author

IRDonch commented Dec 3, 2020

FWIW, you could still include a pyproject.toml, and old pip versions will just ignore it. But that will increase the amount of configurations that need to be tested, so I understand if you don't want to do it.

@ingydotnet
Copy link
Member

@nitzmahone what's the alternative to https://github.com/yaml/pyyaml/blob/release/5.4/pyproject.toml for the 5.4 release.

I'd like to at least delay add this file until we have a more comprehensive need for it.

@nitzmahone
Copy link
Member

Addressed in #407

@IRDonch
Copy link
Author

IRDonch commented Jan 15, 2021

I tested it with PyYAML 5.4b2, and it works. Thanks for the fix.

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

4 participants