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

Cannot install or update Maestral #948

Closed
nyanpasu64 opened this issue Mar 11, 2023 · 4 comments
Closed

Cannot install or update Maestral #948

nyanpasu64 opened this issue Mar 11, 2023 · 4 comments

Comments

@nyanpasu64
Copy link

Describe the bug
When running pipx install maestral[gui] or pipx upgrade-all, it crashes:

How to reproduce

nyanpasu64@ryzen ~ [2]> pipx install --verbose maestral[gui]
pipx >(setup:757): pipx version is 1.1.0
pipx >(setup:758): Default python interpreter is '/usr/bin/python'
pipx >(package_name_from_spec:323): Determined package name: maestral
pipx >(package_name_from_spec:324): Package name determined in 0.0s
creating virtual environment...
pipx >(run_subprocess:173): running /usr/bin/python -m venv --without-pip /home/nyanpasu64/.local/pipx/venvs/maestral
pipx >(run_subprocess:173): running /home/nyanpasu64/.local/pipx/venvs/maestral/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:173): running /home/nyanpasu64/.local/pipx/shared/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:173): running /home/nyanpasu64/.local/pipx/venvs/maestral/bin/python --version
pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: maestral[gui]
installing maestral from spec 'maestral[gui]'...
pipx >(run_subprocess:173): running /home/nyanpasu64/.local/pipx/venvs/maestral/bin/python -m pip install maestral[gui]
pipx >(run_subprocess:173): running <fetch_info_in_venv commands>

pipx >(rmdir:55): removing directory /home/nyanpasu64/.local/pipx/venvs/maestral
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/packaging/requirements.py", line 35, in __init__
    parsed = parse_requirement(requirement_string)
  File "/usr/lib/python3.10/site-packages/packaging/_parser.py", line 64, in parse_requirement
    return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
  File "/usr/lib/python3.10/site-packages/packaging/_parser.py", line 82, in _parse_requirement
    url, specifier, marker = _parse_requirement_details(tokenizer)
  File "/usr/lib/python3.10/site-packages/packaging/_parser.py", line 120, in _parse_requirement_details
    specifier = _parse_specifier(tokenizer)
  File "/usr/lib/python3.10/site-packages/packaging/_parser.py", line 206, in _parse_specifier
    with tokenizer.enclosing_tokens("LEFT_PARENTHESIS", "RIGHT_PARENTHESIS"):
  File "/usr/lib/python3.10/contextlib.py", line 142, in __exit__
    next(self.gen)
  File "/usr/lib/python3.10/site-packages/packaging/_tokenizer.py", line 183, in enclosing_tokens
    self.raise_syntax_error(
  File "/usr/lib/python3.10/site-packages/packaging/_tokenizer.py", line 163, in raise_syntax_error
    raise ParserSyntaxError(
packaging._tokenizer.ParserSyntaxError: Expected closing RIGHT_PARENTHESIS
    stone (>=2.*)
          ~~~~^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/pipx", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3.10/site-packages/pipx/main.py", line 819, in cli
    return run_pipx_command(parsed_pipx_args)
  File "/usr/lib/python3.10/site-packages/pipx/main.py", line 202, in run_pipx_command
    return commands.install(
  File "/usr/lib/python3.10/site-packages/pipx/commands/install.py", line 60, in install
    venv.install_package(
  File "/usr/lib/python3.10/site-packages/pipx/venv.py", line 244, in install_package
    self._update_package_metadata(
  File "/usr/lib/python3.10/site-packages/pipx/venv.py", line 318, in _update_package_metadata
    venv_package_metadata = self.get_venv_metadata_for_package(
  File "/usr/lib/python3.10/site-packages/pipx/venv.py", line 300, in get_venv_metadata_for_package
    venv_metadata = inspect_venv(
  File "/usr/lib/python3.10/site-packages/pipx/venv_inspect.py", line 251, in inspect_venv
    app_paths_of_dependencies = _dfs_package_apps(
  File "/usr/lib/python3.10/site-packages/pipx/venv_inspect.py", line 142, in _dfs_package_apps
    app_paths_of_dependencies = _dfs_package_apps(
  File "/usr/lib/python3.10/site-packages/pipx/venv_inspect.py", line 121, in _dfs_package_apps
    dependencies = get_package_dependencies(
  File "/usr/lib/python3.10/site-packages/pipx/venv_inspect.py", line 54, in get_package_dependencies
    for req in map(Requirement, dist.requires or []):
  File "/usr/lib/python3.10/site-packages/packaging/requirements.py", line 37, in __init__
    raise InvalidRequirement(str(e)) from e
packaging.requirements.InvalidRequirement: Expected closing RIGHT_PARENTHESIS
    stone (>=2.*)
          ~~~~^

Expected behavior
pipx does not crash.

This may be the same bug as #924, which is closed saying it's an upstream packaging 22.0 bug pypa/packaging#629. But I have packaging 23.0 installed from Arch Linux, which should have the bug fixed, but I'm still getting this crash.

@dukecat0 dukecat0 added upstream Bug in dependency and removed upstream Bug in dependency labels Mar 11, 2023
@dukecat0
Copy link
Member

Can you confirm that you are using packaging 23.0 by running /usr/bin/python -m pip list | grep "packaging"?

@nyanpasu64
Copy link
Author

nyanpasu64@ryzen ~> /usr/bin/python -m pip list | grep "packaging"
packaging                     23.0
nyanpasu64@ryzen ~> ls -ld /usr/lib/python3.10/site-packages/packaging-*.dist-info
drwxr-xr-x 1 root root 102 Feb 12 09:26 /usr/lib/python3.10/site-packages/packaging-23.0.dist-info/

@uranusjr
Copy link
Member

It's not the same bug. The >=2.* specifier is invalid. See https://discuss.python.org/t/22782

@uranusjr uranusjr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2023
@nyanpasu64
Copy link
Author

nyanpasu64 commented Mar 12, 2023

How can I tell which package contains stone (>=2.*)? Maestral itself only imports dropbox.stone_validators, and maestral-qt doesn't reference stone at all.

Eventually I found through trial and error that dropbox-11.36.0.dist-info/METADATA contains 27:Requires-Dist: stone (>=2.*), but I'd like pipx to print the package with invalid metadata, rather than failing with a messy stack trace.

(Upstream bug: dropbox/dropbox-sdk-python#458)

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

3 participants