开发者

I want to create this environment variable for everyone, but it does not load during startup? (linux)

开发者 https://www.devze.com 2022-12-09 14:47 出处:网络
I put this at the top, using \"sudo vi /etc/profile\": PYTHONPATH=/home/myuser:/home/myotheruser When I use putty and log in under my username, the python path does not work!

I put this at the top, using "sudo vi /etc/profile":

PYTHONPATH=/home/myuser:/home/myotheruser

When I use putty and log in under my username, the python path does not work! I type "set", and it is there. But, importing things from that directory still does not work.

When I manually do this, then it will work.

EXPORT PYTHONPATH=/home/myuser:/home/myotheruser

However, I don't want to do that everytime. I simply want this path to be app开发者_运维问答ended to everyone, at startup.


You need to export the PYTHONPATH even in /etc/profile.

Make sure you have these lines both in /etc/profile.

PYTHONPATH=...
export PYTHONPATH

After that login again.

0

精彩评论

暂无评论...
验证码 换一张
取 消