-
Notifications
You must be signed in to change notification settings - Fork 187
Only set PYTHONHOME when using conda #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,7 +189,7 @@ const programname = pysys(python, "executable") | |
|
|
||
| # Get PYTHONHOME, either from the environment or from Python | ||
| # itself (if it is not in the environment or if we are using Conda) | ||
| PYTHONHOME = if !haskey(ENV, "PYTHONHOME") || use_conda | ||
| PYTHONHOME = if use_conda | ||
| # PYTHONHOME tells python where to look for both pure python | ||
| # and binary modules. When it is set, it replaces both | ||
| # `prefix` and `exec_prefix` and we thus need to set it to | ||
|
|
@@ -200,7 +200,7 @@ PYTHONHOME = if !haskey(ENV, "PYTHONHOME") || use_conda | |
| exec_prefix = pysys(python, "exec_prefix") | ||
| is_windows() ? exec_prefix : pysys(python, "prefix") * ":" * exec_prefix | ||
| else | ||
| ENV["PYTHONHOME"] | ||
| get(ENV, "PYTHONHOME", nothing) | ||
| end | ||
|
|
||
| # cache the Python version as a Julia VersionNumber | ||
|
|
@@ -238,8 +238,8 @@ writeifchanged("deps.jl", """ | |
| const pyprogramname = "$(escape_string(programname))" | ||
| const wpyprogramname = $(wstringconst(programname)) | ||
| const pyversion_build = $(repr(pyversion)) | ||
| const PYTHONHOME = "$(escape_string(PYTHONHOME))" | ||
| const wPYTHONHOME = $(wstringconst(PYTHONHOME)) | ||
| const PYTHONHOME = $(PYTHONHOME == nothing ? nothing : "\"" * escape_string(PYTHONHOME) * "\"") | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if this is the best way to do this |
||
| const wPYTHONHOME = $(PYTHONHOME == nothing ? nothing : wstringconst(PYTHONHOME)) | ||
|
|
||
| "True if we are using the Python distribution in the Conda package." | ||
| const conda = $use_conda | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at what
Py_SetPythonHomedoes after we first got this going, maybe it would be easier to doget(ENV, "PYTHONHOME", "")and possibly not need the rest of the patch after this point. Dunno whether a user having the env varPYTHONHOMEset to an empty string is sane and should be honored.