-
-
Notifications
You must be signed in to change notification settings - Fork 497
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
Jedi has wrong sys.path when target environment has non-standard library location #1617
Comments
I guess this is a good proposal. Since this is not very important to me, are you willing to do this in a PR? I would probably not name it |
I'll be happy to submit the PR. |
That's fine. |
mrclary
pushed a commit
to mrclary/python-language-server
that referenced
this issue
Jun 20, 2020
mrclary
pushed a commit
to mrclary/python-language-server
that referenced
this issue
Jun 21, 2020
mrclary
pushed a commit
to mrclary/python-language-server
that referenced
this issue
Jun 21, 2020
Fixed by #1619 |
mrclary
pushed a commit
to mrclary/python-language-server
that referenced
this issue
Jun 21, 2020
…davidhalter/jedi#1617 and davidhalter/jedi#1619) * Requires jedi>=0.17.2
mrclary
pushed a commit
to mrclary/python-language-server
that referenced
this issue
Jun 25, 2020
…davidhalter/jedi#1617 and davidhalter/jedi#1619) * Requires jedi>=0.17.2
Closed
10 tasks
Merged
mrclary
pushed a commit
to mrclary/python-language-server
that referenced
this issue
Jul 19, 2020
…davidhalter/jedi#1617 and davidhalter/jedi#1619) * Requires jedi>=0.17.2
mrclary
pushed a commit
to mrclary/python-language-server
that referenced
this issue
Aug 21, 2020
…davidhalter/jedi#1617 and davidhalter/jedi#1619) * Requires jedi>=0.17.2
mrclary
pushed a commit
to mrclary/python-language-server
that referenced
this issue
Sep 15, 2020
…davidhalter/jedi#1617 and davidhalter/jedi#1619) * Requires jedi>=0.17.2
mrclary
pushed a commit
to mrclary/python-language-server
that referenced
this issue
Sep 23, 2020
…davidhalter/jedi#1617 and davidhalter/jedi#1619) * Requires jedi>=0.17.2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@davidhalter,
Okay, when I submitted #1540, the problem arose when the host environment was a pyenv environment and the target environment was a conda environment. The solution was that the target environment should not inherit system environment variables from the host environment, i.e. the
CompiledSubprocess
should spawn a clean environment. Well, this works as it should when the target environment python libraries are in a standard relative location, i.e.../lib
relative to the the executable. Unfortunately, this does not work for target environments where the python libraries are not in a standard location, such as for python embedded in MacOS applications (see Spyder Mac App)Python provides a mechanism for handling this, namely by setting the
PYTHONHOME
environment variable to the base directory of the libraries. This, along with other potentialPYTHON...
environment variables, were causing the problem outlined in #1540. Essentially, the wrong python environment variables were being inherited by the subprocess and mucking things up. In the absence ofPYTHONHOME
, it will find the libraries in the standard location.So, I still think that starting a python subprocess with a clean environment is the correct paradigm, I now think that the solution provided for #1540 in #1546 is incomplete and should include a mechanism for passing explicit environment variables to the subprocess.
Popen
already does this, of course, with theenv
keyword arg. I propose modifyingCompiledSubprocess
to accept anenv
keyword argument that will be passed to the subprocess. The default should be an empty dictionary, but the user has the option to pass in envrionment variables explicitly, if needed.What are your thougthts?
The text was updated successfully, but these errors were encountered: