diff --git a/pipenv/utils/dependencies.py b/pipenv/utils/dependencies.py index 37b3c0552..251fd05c9 100644 --- a/pipenv/utils/dependencies.py +++ b/pipenv/utils/dependencies.py @@ -1132,6 +1132,11 @@ def install_req_from_pipfile(name, pipfile): version = "" req_str = f"{name}{extras_str}{version}" + # Handle markers before constructing InstallRequirement + markers = PipenvMarkers.from_pipfile(name, _pipfile) + if markers: + req_str = f"{req_str};{markers}" + install_req, _ = expansive_install_req_from_line( req_str, comes_from=None, @@ -1141,7 +1146,6 @@ def install_req_from_pipfile(name, pipfile): constraint=False, expand_env=True, ) - markers = PipenvMarkers.from_pipfile(name, _pipfile) return install_req, markers, req_str