Python Forum
How to set LD_LIBRARY_PATH on python codes?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to set LD_LIBRARY_PATH on python codes?
#1
I am using eclipse ide. So I configure LD_LIBRARY_PATH environment variable on eclipse ide. But I try to generate python codes which are independent on development ide. I want to generate codes which export environment variables on python codes dynamically. These are my sample codes.

import os, sys
import subprocess

my_env = os.environ.copy()
my_env["LD_LIBRARY_PATH"] = "/home/joseph/hadoop/lib/native"

subprocess.Popen('export', env=my_env)
But these codes throws exception,

Error:
FileNotFoundError: [Errno 2] No such file or directory: 'export'
I also try to execute
os.execv('export', ['LD_LIBRARY_PATH'])
But fail again.
Kindly inform me how to configure LD_LIBRARY_PATH variable on python codes. Best regards.
Reply


Messages In This Thread
How to set LD_LIBRARY_PATH on python codes? - by aupres - Mar-25-2021, 08:32 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to load log.txt directly into python codes? sparkt 6 3,024 Aug-21-2020, 03:51 PM
Last Post: sparkt
  Python 3 escape codes oldDog 1 2,624 Sep-15-2018, 10:12 AM
Last Post: gruntfutuk
  Sending different color codes in python at certain times Kimzer 4 3,460 Jun-18-2018, 06:56 PM
Last Post: gontajones

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020