LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-09-2011, 01:51 PM   #1
estratos
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 85

Rep: Reputation: 15
Set pythonpath from script at boot time


Hi, under Debian, I need to add some paths to the PYTHONPATH environment variable for all users, including root. I want to do this because I have a custom sh script in /etc/init.d that runs a couple of python scripts needing the new pythonpath. The problem is that whatever I try only alters PYTHONPATH in the context of an open shell. No way to do this during startup.

I've tried exporting the new PYTHONPATH from the sh script as follows:

export PYTHONPATH="$PYTHONPATH:/new/path/"

and also running a new Python script that calls sys.path.append

but nothing works.

Thanks in advance for your ideas!
 
Old 12-11-2011, 02:39 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Have a look at a file named site.py in /usr/lib/python<version>/ and in /usr/lib/python<version>/dist-packages. There you'll find the information you need to set / change your PYTHONPATH. More information and clarification can be found here on the Python documentation website.

Kind regards,

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How are permissions on /dev devices set at boot time? faentur Linux - Security 5 02-19-2009 07:06 PM
Not able to set system time using script. muthu@sanatdata.net Linux - Server 2 04-25-2008 03:46 PM
How can I change/set the MAC address at boot time under SuSE? Basel Linux - Networking 6 10-20-2006 12:23 AM
ip_forward set to 0 at boot time gauge73 Linux - Networking 5 09-26-2005 05:10 PM
Radeon Framebuffer - how to set at boot time? wraycarr Linux - Hardware 0 10-09-2003 12:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration