1

I am having trouble adding current PATH permanently on my ubuntu server for a postgresql user.

Every time I ssh or restart the server I have to run export PATH="${PATH}:${HOME}/.local/bin", I am running a python script which will not work unless this command is done so I tried a a simple addition of this in python but it didn't solve.

import os
cmd ='''export PATH="${PATH}:${HOME}/.local/bin"'''
os.system(cmd)
... rest of my code

I also tried sudo export PATH="${PATH}:${HOME}/.local/bin" but it gets removed after each restart what can I do to permanently add this path or make the python script run it.

mchid
  • 44,904
  • 8
  • 102
  • 162
User19
  • 165

1 Answers1

1

Add your path change to .bashrc perhaps

PATH="$PATH:$HOME/.local/bin"

Notice there is no export or other fancy stuff in the line

mchid
  • 44,904
  • 8
  • 102
  • 162
quill
  • 1,015