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

pip install argparse-manpage fails on RHEL8 with system pip3 #96

Open
vashirov opened this issue Jun 16, 2023 · 2 comments
Open

pip install argparse-manpage fails on RHEL8 with system pip3 #96

vashirov opened this issue Jun 16, 2023 · 2 comments

Comments

@vashirov
Copy link

$ pip3 --version
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)

$ pip3 install --user argparse-manpage
Collecting argparse-manpage
  Using cached https://files.pythonhosted.org/packages/d3/5f/3353e1dd33fcb3801cfe7e6412ad9d75202fc642679d105015e361aceef7/argparse-manpage-4.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "/tmp/pip-build-dwy7230y/argparse-manpage/build_manpages/build_manpages.py", line 10, in <module>
        import tomllib
    ModuleNotFoundError: No module named 'tomllib'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/tmp/pip-build-dwy7230y/argparse-manpage/build_manpages/build_manpages.py", line 14, in <module>
        import tomli as tomllib
    ModuleNotFoundError: No module named 'tomli'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-dwy7230y/argparse-manpage/setup.py", line 11, in <module>
        from build_manpages import __version__
      File "/tmp/pip-build-dwy7230y/argparse-manpage/build_manpages/__init__.py", line 6, in <module>
        from .build_manpages import build_manpages, get_build_py_cmd, get_install_cmd
      File "/tmp/pip-build-dwy7230y/argparse-manpage/build_manpages/build_manpages.py", line 17, in <module>
        import toml as tomllib
    ModuleNotFoundError: No module named 'toml'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dwy7230y/argparse-manpage/

It installs fine in venv and latest versions of pip (at least starting with python38-pip-19.3.). So I suspect that pip-9.0.3 can't handle unresolved dependencies while importing build_manpages in setup.py:

from build_manpages import __version__

if sys.version_info >= (3,):
install_requires = ['tomli;python_version<"3.11"']
else:
install_requires = ['toml']

try:
import tomllib
from tomllib import TOMLDecodeError
except ImportError:
try:
import tomli as tomllib
from tomli import TOMLDecodeError
except ImportError:
import toml as tomllib
from toml import TomlDecodeError as TOMLDecodeError

@praiskup
Copy link
Owner

Hm, thank you for the report! Do you see some possible solution?

@vashirov
Copy link
Author

So this issue and PEP 668 made us re-evaluate how we install packages in our test systems.
As a workaround, I added a step in our ansible playbook to install python3-tomli explicitly before installing argparse-manpage via pip.
I'm switching our automation to use virtualenv, so the old pip (<10.0.0) won't be an issue.

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

2 participants