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

InvalidRequirement error while installing package PlexTraktSync using pipx #924

Closed
29axe opened this issue Dec 9, 2022 · 5 comments
Closed
Labels
upstream Bug in dependency

Comments

@29axe
Copy link

29axe commented Dec 9, 2022

Describe the bug

I tried to install package PlexTraktSync and it keeps failing, raising exception about InvalidRequirement, related to furo package version.

I tried multiple versions of the package, mulitple versions of python (3.10 / 3.11).
I tried all the steps in troubleshooting page (package installs correctly using pip in test env).
I tried installing another package and it did not raise this issue.
I don't know why this happens only with this particular package.

How to reproduce

pipx install PlexTraktSync --verbose
On Windows 10, python 3.10.9 installed globally using installer x64 (not from the store).

PS C:\Users\USER.local> pipx install PlexTraktSync --verbose
pipx >(setup:757): pipx version is 1.1.0
pipx >(setup:758): Default python interpreter is 'C:\Program Files\Python310\python.exe'
pipx >(mkdir:81): creating directory C:\Users\USER.local\pipx\venvs
pipx >(mkdir:81): creating directory C:\Users\USER.local\pipx.cache
pipx >(package_name_from_spec:323): Determined package name: plextraktsync
pipx >(package_name_from_spec:324): Package name determined in 0.0s
creating virtual environment...
pipx >(run_subprocess:173): running C:\Program Files\Python310\python.exe -m venv --without-pip C:\Users\USER.local\pipx\venvs\plextraktsync
creating shared libraries...
pipx >(run_subprocess:173): running C:\Program Files\Python310\python.exe -m venv --clear C:\Users\USER.local\pipx\shared
pipx >(upgrade:91): Upgrading shared libraries in C:\Users\USER.local\pipx\shared
upgrading shared libraries...
pipx >(run_subprocess:173): running C:\Users\USER.local\pipx\shared\Scripts\python.exe -m pip --disable-pip-version-check install --force-reinstall --upgrade pip setuptools wheel
pipx >(run_subprocess:173): running C:\Users\USER.local\pipx\venvs\plextraktsync\Scripts\python.exe -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:173): running C:\Users\USER.local\pipx\shared\Scripts\python.exe -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:173): running C:\Users\USER.local\pipx\venvs\plextraktsync\Scripts\python.exe --version
pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: plextraktsync
installing plextraktsync...
pipx >(run_subprocess:173): running C:\Users\USER.local\pipx\venvs\plextraktsync\Scripts\python.exe -m pip install plextraktsync
pipx >(run_subprocess:173): running <fetch_info_in_venv commands>

pipx >(rmdir:55): removing directory C:\Users\USER.local\pipx\venvs\plextraktsync
Traceback (most recent call last):
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\packaging\requirements.py", line 35, in init
parsed = parse_requirement(requirement_string)
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\packaging_parser.py", line 64, in parse_requirement
return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\packaging_parser.py", line 82, in _parse_requirement
url, specifier, marker = _parse_requirement_details(tokenizer)
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\packaging_parser.py", line 116, in _parse_requirement_details
specifier = _parse_specifier(tokenizer)
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\packaging_parser.py", line 203, in _parse_specifier
with tokenizer.enclosing_tokens("LEFT_PARENTHESIS", "RIGHT_PARENTHESIS"):
File "C:\Program Files\Python310\lib\contextlib.py", line 142, in exit
next(self.gen)
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\packaging_tokenizer.py", line 181, in enclosing_tokens
self.raise_syntax_error(
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\packaging_tokenizer.py", line 161, in raise_syntax_error
raise ParserSyntaxError(
packaging._tokenizer.ParserSyntaxError: Expected closing RIGHT_PARENTHESIS
furo (>=2021.8.17-beta.43,<2022.0.0); extra == "docs"
~~~~~~~~~~~~~~^

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

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "c:\users\USER\appdata\roaming\python\python310\scripts\pipx.exe_main
.py", line 7, in
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pipx\main.py", line 819, in cli
return run_pipx_command(parsed_pipx_args)
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pipx\main.py", line 202, in run_pipx_command
return commands.install(
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pipx\commands\install.py", line 60, in install
venv.install_package(
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pipx\venv.py", line 244, in install_package
self._update_package_metadata(
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pipx\venv.py", line 318, in _update_package_metadata
venv_package_metadata = self.get_venv_metadata_for_package(
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pipx\venv.py", line 300, in get_venv_metadata_for_package
venv_metadata = inspect_venv(
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pipx\venv_inspect.py", line 251, in inspect_venv
app_paths_of_dependencies = _dfs_package_apps(
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pipx\venv_inspect.py", line 142, in _dfs_package_apps
app_paths_of_dependencies = _dfs_package_apps(
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pipx\venv_inspect.py", line 121, in _dfs_package_apps
dependencies = get_package_dependencies(
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pipx\venv_inspect.py", line 54, in get_package_dependencies
for req in map(Requirement, dist.requires or []):
File "C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\packaging\requirements.py", line 37, in init
raise InvalidRequirement(str(e)) from e
packaging.requirements.InvalidRequirement: Expected closing RIGHT_PARENTHESIS
furo (>=2021.8.17-beta.43,<2022.0.0); extra == "docs"
~~~~~~~~~~~~~~^
PS C:\Users\USER.local>

Expected behavior

Install without raising issue.

@dukecat0
Copy link
Member

dukecat0 commented Dec 9, 2022

I think this is related to pypa/packaging#629.

@glensc
Copy link

glensc commented Dec 9, 2022

what's the workaround? downgrade pip? uninstall something?

@dukecat0
Copy link
Member

dukecat0 commented Dec 9, 2022

@29axe You can check the version of packaging with pip list.

If you have packaging 22.0, you can downgrade it to 21.3 by pip install packaging==21.3.

@29axe
Copy link
Author

29axe commented Dec 9, 2022

Could not test before. I just downgraded packaging to 21.3 and it worked.

@uranusjr
Copy link
Member

Closing this since we can’t do anything about it here.

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

No branches or pull requests

4 participants