Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    !#/usr/bin/env python can also be used, in case the python executable doesn't reside in /usr/bin Commented May 5, 2016 at 20:50
  • Neither worked out. I added the line you mentioned in the start of the script, used chmod +x, exported the PATH and tried to execute the file and it says "fit_locus: command not found" Commented May 6, 2016 at 12:33
  • Here's the output: root@astrolab15:~# vim /opt/big-macs-calibrate/fit_locus.py root@astrolab15:~# chmod +x /opt/big-macs-calibrate/fit_locus.py root@astrolab15:~# export PATH=$PATH:/opt/big-macs-calibrate/ root@astrolab15:~# fit_locus --help fit_locus: command not found Commented May 6, 2016 at 12:33
  • Ah! I was unclear. You have to remove the .py suffix by renaming the file, removing it from both the filename and what the user types. Right now, the user should be able to type fit_locus.py --help, but after you mv fit_locus.py fit_locus then the shell will find it. Commented May 6, 2016 at 13:24
  • Still didn't work, same error as before (command not found) Commented May 16, 2016 at 19:47