Skip to content

Commit 1e3de7b

Browse files
authored
Merge pull request #515 from mkitti/pr445_master
Rebase of #445
2 parents 6b8c10d + 37bbded commit 1e3de7b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/julia/tools.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,19 @@ def julia_py_executable():
162162

163163
# try to find installed julia-py script - check scripts folders under different installation schemes
164164
# we check the alternate schemes first, at most one of which should give us a julia-py script
165+
# if the environment variable `PYTHONPATH` is set, we additionally check whether the script is there
165166
# if no candidate in an alternate scheme, try the standard install location
166167
# see https://docs.python.org/3/install/index.html#alternate-installation
167168
scripts_paths = [
168-
sysconfig.get_path("scripts", scheme) for scheme in sysconfig.get_scheme_names()
169+
*[
170+
sysconfig.get_path("scripts", scheme)
171+
for scheme in sysconfig.get_scheme_names()
172+
],
173+
*[
174+
os.path.join(pypath, "bin")
175+
for pypath in os.environ.get("PYTHONPATH", "").split(os.pathsep)
176+
if pypath
177+
],
169178
]
170179
scripts_paths.append(sysconfig.get_path("scripts"))
171180

0 commit comments

Comments
 (0)