Closed Azureblade3808 closed 2 years ago
we are getting the search path through this which uses child_process.execFileSync that has this characteristic
The child_process.execFile() function is similar to child_process.exec() except that it does not spawn a shell by default. Rather, the specified executable file is spawned directly as a new process making it slightly more efficient than child_process.exec().
execFileSync is just sync version of execFile.
@Azureblade3808 are you asking to make it work when PYTHONPATH is set at /etc/profile?
@heejaechang Yes. Or if there is some way to set PYTHONPATH for a spawned process, please let me know.
Solved by moving PYTHONPATH
setting from "/etc/bashrc" to "/etc/environment".
What if you don't not have admin access and cannot edit /etc/environment?
There are other ways to set an environment variable: https://stackoverflow.com/questions/45502996/how-to-set-environment-variable-in-linux-permanently
I am trying to setup a remote environment. I have set a
PYTHONPATH
environment variable, and have added it into both/etc/profile
and/etc/bashrc
. When I run VScode on the server computer, the path provided inPYTHONPATH
is getting resolved. When I run VScode on the client computer and connect to the server with Remote-SSH,PYTHONPATH
on the server is not taking effect and modules placed inPYTHONPATH
are not recognized. Running python files using those modules is successful though.I'm not sure if I have some config errors. Below is the info related.
Local System: Windows 10 Remote System: CentOS Linux 7
"settings.json" --
Output from "Python Language Server", truncated --
Output from "Remote - SSH" --
Result of running
export
in the Terminal tab --Edit:
PYTHONPATH
has been set in both/etc/profile
and/etc/bashrc
on the server. It seems that only/etc/bashrc
takes effect.