blob: 04cf0ed9e317460f69fd532f378c4a8dc7b52a6d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
diff --git a/pipenv/patched/pip/__main__.py b/pipenv/patched/pip/__main__.py
index b424ab20..79d52838 100644
--- a/pipenv/patched/pip/__main__.py
+++ b/pipenv/patched/pip/__main__.py
@@ -28,6 +28,13 @@ if __name__ == "__main__":
)
import importlib.util
import sys
+
+
+ SITE_PACKAGES_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
+
+ # Inject site directory into system path.
+ sys.path.insert(-1, SITE_PACKAGES_ROOT)
+
spec = importlib.util.spec_from_file_location(
"pipenv", location=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "__init__.py"))
pipenv = importlib.util.module_from_spec(spec)
diff --git a/pipenv/resolver.py b/pipenv/resolver.py
index 3fea0a1e..a0d9da29 100644
--- a/pipenv/resolver.py
+++ b/pipenv/resolver.py
@@ -6,6 +6,11 @@ import sys
os.environ["PIP_PYTHON_PATH"] = str(sys.executable)
+SITE_PACKAGES_ROOT = os.path.dirname(os.path.dirname(__file__))
+
+# Inject site directory into system path.
+sys.path.insert(-1, SITE_PACKAGES_ROOT)
+
def _ensure_modules():
spec = importlib.util.spec_from_file_location(
|