Problem executing python script placed in ~/bin folder

Forum rules
Before you post please read how to get help
Post Reply
alo0oz
Level 1
Level 1
Posts: 12
Joined: Thu Aug 17, 2017 1:59 pm

Problem executing python script placed in ~/bin folder

Post by alo0oz » Fri Sep 07, 2018 11:35 pm

I have a python script. i have changed it's permission by "chmod +x py_mem.py" . then i have symlinked it to ~/bin/pymem. Now though if i try "which pymem" i get "/home/user/bin/pymem", i can't run the script without absolute path "~/bin/pymem".

User avatar
smurphos
Level 6
Level 6
Posts: 1386
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Problem executing python script placed in ~/bin folder

Post by smurphos » Sat Sep 08, 2018 1:53 am

What does $PATH input into the terminal return?

If it doesn't include/home/<user>/bin what does cat .profile return

Finally where are you trying to launch the script from? If cron then that's a special case as cron runs in a barebones environment and you generally need to globally specify $PATH in the crontab or launch command via the full path.

Post Reply

Return to “Scripts & Bash”