mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Correctly populate the system python path
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Fix a bug that incorrect Python path will be used when ``--system`` flag is on.
|
||||
@@ -1946,6 +1946,8 @@ def do_install(
|
||||
# Automatically use an activated virtualenv.
|
||||
if PIPENV_USE_SYSTEM:
|
||||
system = True
|
||||
if system:
|
||||
os.environ["PIPENV_USE_SYSTEM"] = "1"
|
||||
# Check if the file is remote or not
|
||||
if remote:
|
||||
click.echo(
|
||||
|
||||
@@ -267,7 +267,10 @@ class Environment(object):
|
||||
def python(self):
|
||||
# type: () -> str
|
||||
"""Path to the environment python"""
|
||||
py = vistir.compat.Path(self.script_basedir).joinpath("python").absolute().as_posix()
|
||||
if os.name == "nt" and not self.is_venv:
|
||||
py = vistir.compat.Path(self.prefix).joinpath("python").absolute().as_posix()
|
||||
else:
|
||||
py = vistir.compat.Path(self.script_basedir).joinpath("python").absolute().as_posix()
|
||||
if not py:
|
||||
return vistir.compat.Path(sys.executable).as_posix()
|
||||
return py
|
||||
|
||||
Reference in New Issue
Block a user