|
8 | 8 |
|
9 | 9 | @init begin
|
10 | 10 | # Check if libpython is already loaded (i.e. if the Julia interpreter was started from a Python process)
|
11 |
| - CONFIG.isembedded = haskey(ENV, "PYTHONJL_LIBPTR") |
| 11 | + CONFIG.isembedded = haskey(ENV, "JULIA_PYTHONCALL_LIBPTR") |
12 | 12 |
|
13 | 13 | if CONFIG.isembedded
|
14 | 14 | # In this case, getting a handle to libpython is easy
|
15 |
| - CONFIG.libptr = Ptr{Cvoid}(parse(UInt, ENV["PYTHONJL_LIBPTR"])) |
| 15 | + CONFIG.libptr = Ptr{Cvoid}(parse(UInt, ENV["JULIA_PYTHONCALL_LIBPTR"])) |
16 | 16 | # Check Python is initialized
|
17 | 17 | C.Py_IsInitialized() == 0 && error("Python is not already initialized.")
|
18 | 18 | CONFIG.isinitialized = CONFIG.preinitialized = true
|
19 | 19 | else
|
20 | 20 | # Find Python executable
|
21 | 21 | exepath = something(
|
22 | 22 | CONFIG.exepath,
|
23 |
| - get(ENV, "PYTHONJL_EXE", nothing), |
| 23 | + get(ENV, "JULIA_PYTHONCALL_EXE", nothing), |
24 | 24 | Sys.which("python3"),
|
25 | 25 | Sys.which("python"),
|
26 | 26 | Some(nothing),
|
|
30 | 30 | """
|
31 | 31 | Could not find Python executable.
|
32 | 32 |
|
33 |
| - Ensure 'python3' or 'python' is in your PATH or set environment variable 'PYTHONJL_EXE' |
| 33 | + Ensure 'python3' or 'python' is in your PATH or set environment variable 'JULIA_PYTHONCALL_EXE' |
34 | 34 | to the path to the Python executable.
|
35 | 35 | """,
|
36 | 36 | )
|
|
52 | 52 |
|
53 | 53 | Ensure either:
|
54 | 54 | - python3 or python is in your PATH
|
55 |
| - - PYTHONJL_EXE is "CONDA" or "CONDA:<env>" |
56 |
| - - PYTHONJL_EXE is the path to the Python executable |
| 55 | + - JULIA_PYTHONCALL_EXE is "CONDA" or "CONDA:<env>" |
| 56 | + - JULIA_PYTHONCALL_EXE is the path to the Python executable |
57 | 57 | """)
|
58 | 58 | end
|
59 | 59 |
|
|
66 | 66 |
|
67 | 67 | # Find Python library
|
68 | 68 | libpath =
|
69 |
| - something(CONFIG.libpath, get(ENV, "PYTHONJL_LIB", nothing), Some(nothing)) |
| 69 | + something(CONFIG.libpath, get(ENV, "JULIA_PYTHONCALL_LIB", nothing), Some(nothing)) |
70 | 70 | if libpath !== nothing
|
71 | 71 | libptr = dlopen_e(path, CONFIG.dlopenflags)
|
72 | 72 | if libptr == C_NULL
|
|
91 | 91 | CONFIG.libpath === nothing && error("""
|
92 | 92 | Could not find Python library for Python executable $(repr(CONFIG.exepath)).
|
93 | 93 |
|
94 |
| - If you know where the library is, set environment variable 'PYTHONJL_LIB' to its path. |
| 94 | + If you know where the library is, set environment variable 'JULIA_PYTHONCALL_LIB' to its path. |
95 | 95 | """)
|
96 | 96 | end
|
97 | 97 |
|
|
0 commit comments