pipenv icon indicating copy to clipboard operation
pipenv copied to clipboard

InstallationError exception (Expected end or semicolon) using requirements with markers

Open fredcohen-aa opened this issue 1 year ago • 3 comments

Issue description

We have a set of mutually-exclusive requirements in our Pipfile to facilitate Arm-based Mac Ever since the release of date when pipenv-2024.1.0 was released our pipenv install command is failing. tensorflow-cpu = {"version"="~=2.13.0", markers="platform_machine != 'arm64'"} tensorflow = {"version"="~=2.13.0", markers="platform_machine == 'arm64'"}

Expected result

Describe what you expected.

Actual result

When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.

Steps to replicate

2024-10-07T17:52:56.9855786Z Updated Pipfile.lock (acf54f59e98de30824501c4502bac36b3200da5011fbfda911e506fe2b611b50)! 2024-10-07T17:52:56.9863105Z To activate this project's virtualenv, run pipenv shell. 2024-10-07T17:52:56.9864686Z Alternatively, run a command inside the virtualenv with pipenv run. 2024-10-07T17:52:57.0046901Z To activate this project's virtualenv, run pipenv shell. 2024-10-07T17:52:57.0048278Z Alternatively, run a command inside the virtualenv with pipenv run. 2024-10-07T17:52:57.0064980Z Installing dependencies from Pipfile.lock (611b50)... 2024-10-07T17:52:57.0215267Z Traceback (most recent call last): 2024-10-07T17:52:57.0231165Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/packaging/requirements.py", line 36, in init 2024-10-07T17:52:57.0254406Z parsed = _parse_requirement(requirement_string) 2024-10-07T17:52:57.0256364Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/packaging/_parser.py", line 62, in parse_requirement 2024-10-07T17:52:57.0257930Z return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES)) 2024-10-07T17:52:57.0260001Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/packaging/_parser.py", line 80, in _parse_requirement 2024-10-07T17:52:57.0261541Z url, specifier, marker = _parse_requirement_details(tokenizer) 2024-10-07T17:52:57.0263583Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/packaging/_parser.py", line 124, in _parse_requirement_details 2024-10-07T17:52:57.0265005Z marker = _parse_requirement_marker( 2024-10-07T17:52:57.0266610Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/packaging/_parser.py", line 145, in _parse_requirement_marker 2024-10-07T17:52:57.0268333Z tokenizer.raise_syntax_error( 2024-10-07T17:52:57.0269918Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/packaging/_tokenizer.py", line 167, in raise_syntax_error 2024-10-07T17:52:57.0271294Z raise ParserSyntaxError( 2024-10-07T17:52:57.0272643Z pipenv.patched.pip._vendor.packaging._tokenizer.ParserSyntaxError: Expected end or semicolon (after name and no valid version specifier) 2024-10-07T17:52:57.0273799Z tensorflow==~=2.13.0 2024-10-07T17:52:57.0274175Z ^ 2024-10-07T17:52:57.0274378Z 2024-10-07T17:52:57.0274975Z The above exception was the direct cause of the following exception: 2024-10-07T17:52:57.0275535Z 2024-10-07T17:52:57.0275695Z Traceback (most recent call last): 2024-10-07T17:52:57.0278061Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_internal/req/constructors.py", line 362, in _parse_req_string 2024-10-07T17:52:57.0279464Z return get_requirement(req_as_string) 2024-10-07T17:52:57.0281022Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_internal/utils/packaging.py", line 45, in get_requirement 2024-10-07T17:52:57.0282532Z return Requirement(req_string) 2024-10-07T17:52:57.0284016Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/packaging/requirements.py", line 38, in init 2024-10-07T17:52:57.0285429Z raise InvalidRequirement(str(e)) from e 2024-10-07T17:52:57.0286672Z pipenv.patched.pip._vendor.packaging.requirements.InvalidRequirement: Expected end or semicolon (after name and no valid version specifier) 2024-10-07T17:52:57.0287888Z tensorflow==~=2.13.0 2024-10-07T17:52:57.0288280Z ^ 2024-10-07T17:52:57.0288484Z 2024-10-07T17:52:57.0288833Z During handling of the above exception, another exception occurred: 2024-10-07T17:52:57.0289366Z 2024-10-07T17:52:57.0289538Z Traceback (most recent call last): 2024-10-07T17:52:57.0290321Z File "/opt/hostedtoolcache/Python/3.10.15/x64/bin/pipenv", line 8, in 2024-10-07T17:52:57.0291063Z sys.exit(cli()) 2024-10-07T17:52:57.0292472Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1157, in call 2024-10-07T17:52:57.0293608Z return self.main(*args, **kwargs) 2024-10-07T17:52:57.0294793Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/cli/options.py", line 52, in main 2024-10-07T17:52:57.0296010Z return super().main(*args, **kwargs, windows_expand_args=False) 2024-10-07T17:52:57.0297446Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1078, in main 2024-10-07T17:52:57.0298524Z rv = self.invoke(ctx) 2024-10-07T17:52:57.0299739Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1688, in invoke 2024-10-07T17:52:57.0300961Z return _process_result(sub_ctx.command.invoke(sub_ctx)) 2024-10-07T17:52:57.0302525Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1434, in invoke 2024-10-07T17:52:57.0303704Z return ctx.invoke(self.callback, **ctx.params) 2024-10-07T17:52:57.0305023Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 783, in invoke 2024-10-07T17:52:57.0306118Z return __callback(*args, **kwargs) 2024-10-07T17:52:57.0307449Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/vendor/click/decorators.py", line 92, in new_func 2024-10-07T17:52:57.0308655Z return ctx.invoke(f, obj, *args, **kwargs) 2024-10-07T17:52:57.0309957Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 783, in invoke 2024-10-07T17:52:57.0311069Z return __callback(*args, **kwargs) 2024-10-07T17:52:57.0312613Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/cli/command.py", line 207, in install 2024-10-07T17:52:57.0313676Z do_install( 2024-10-07T17:52:57.0314845Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/routines/install.py", line 234, in do_install 2024-10-07T17:52:57.0315959Z raise e 2024-10-07T17:52:57.0317112Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/routines/install.py", line 220, in do_install 2024-10-07T17:52:57.0318225Z do_install_dependencies( 2024-10-07T17:52:57.0319574Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/routines/install.py", line 388, in do_install_dependencies 2024-10-07T17:52:57.0320959Z deps_list = list( 2024-10-07T17:52:57.0322331Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/utils/locking.py", line 467, in get_requirements 2024-10-07T17:52:57.0323625Z install_req, _ = expansive_install_req_from_line(pip_line) 2024-10-07T17:52:57.0325261Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/utils/dependencies.py", line 1034, in expansive_install_req_from_line 2024-10-07T17:52:57.0326772Z parts = parse_req_from_line(pip_line, line_source) 2024-10-07T17:52:57.0328384Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_internal/req/constructors.py", line 379, in parse_req_from_line 2024-10-07T17:52:57.0329914Z req: Optional[Requirement] = _parse_req_string(req_as_string) 2024-10-07T17:52:57.0331586Z File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/pipenv/patched/pip/_internal/req/constructors.py", line 376, in _parse_req_string 2024-10-07T17:52:57.0333126Z raise InstallationError(msg) 2024-10-07T17:52:57.0334653Z pipenv.patched.pip._internal.exceptions.InstallationError: Invalid requirement: 'tensorflow==~=2.13.0': Expected end or semicolon (after name and no valid version specifier) 2024-10-07T17:52:57.0336051Z tensorflow==~=2.13.0 2024-10-07T17:52:57.0336459Z ^

fredcohen-aa avatar Oct 07 '24 18:10 fredcohen-aa