![]() Registered Member ![]()
|
Dear all.
I am trying to set an environment variable in dolphin (PYTHONPATH) so that when I start my python programs from dolphin they will have this environment variable as well. I added the PYTHONPATH to my .bashrc and started dolphin from bash. However, the PYTHONPATH was not passed to dolphin because dolphin didn't become a child of bash but a direct child of init. My guess is that this is to prevent multiple instances. So, how can I best pass an environment variable to dolphin? I've found the -nofork option but then I can only start dolphin once. This is not ideal. Thanks in advance. |
![]() Manager ![]()
|
did you export PYTHONPATH=
did you restart KDE after adding the var? .bashrc changes don't take affect until the file is re-parsed, starting a new konsole tab then starting Dolphin in that tab should do it does it show in printenv?
|
![]() Registered Member ![]()
|
Yes i have exported the PYTHON path and it shows up when I do printevn | grep PYTHONPATH. However, I am not root on this machine so I cannot restart KDE.
The problem seems to me that dolphin is not a child of bash (as eclipse and kate are). I checked and there was no dolphin instance running before I started it from the command-line. Here is my ps output:
|
![]() Manager ![]()
|
if you open a new Konsole tab is PYTHONPATH what you wish?
|
![]() Registered Member ![]()
|
Yes, the PYTHONPATH variable has the correct value when I open a new Konsole tab.
|
![]() Moderator ![]()
|
What is your KDE version? Since KDE 4.7, the Dolphin process should actually be a child of bash, and the --nofork option that you mentioned does not exist any more.
|
![]() Manager ![]()
|
using ksysguard I'm seeing Dolphin is a child of kdeint4 ![]() |
![]() Registered Member ![]()
|
I'm using KDE 4.3.4. I guess that's pretty old.
|
![]() Registered Member ![]()
|
And by the way, I'm using dolphin version 1.3
|
![]() Moderator ![]()
|
Hopefully not so if you run Dolphin from a Konsole - in that case, it should definitely be a child of the shell process.
It's indeed extremely old. The current version is KDE 4.10.1. Therefore, the solution to your problem is quite easy: upgrade! Which is probably a good idea anyway because a distro that was released in 2009 does probably not get updates any more and is packed with unfixed security vulnerabilities. |
![]() Administrator ![]()
|
As an alternative solution to this issue, create a executable script in $(kde4-config --localprefix)/env with the content you need to setup PYTHONPATH properly. This will ensure it is propagated to Dolphin (and all other applications started as part of your KDE session).
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Manager ![]()
|
true, |
![]() Registered Member ![]()
|
I talked to the administrator of the system. We are using Redhat Enterprise Linux 6.4, which is the most recent version. It seems to me that this distribution has the emphasis on stability, not on keeping up with the latest version. Anyhow, upgrading is not an option.
I will try bcooksley's solution Monday at work. Thanks all for your help. |
![]() Administrator ![]()
|
Do note that in order for my solution to take effect, it is required to logout and back in again.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]