Problem executing python script placed in ~/bin folder

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
alo0oz

Problem executing python script placed in ~/bin folder

Post by alo0oz »

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".
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

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

Post by smurphos »

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.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
Locked

Return to “Scripts & Bash”