passff-host icon indicating copy to clipboard operation
passff-host copied to clipboard

Possible incorrect shebang on macOS

Open pletcher opened this issue 3 years ago • 4 comments

General information. Describe your environment

  • Versions

    • Operating system: macOS 12.3.1
    • Browser: Firefox 100
    • PassFF: 1.14
    • Host app: 1.2.3
  • How have you installed the host app?

curl -sSL github.com/passff/passff-host/releases/latest/download/install_host_app.sh | bash -s -- firefox

  • Your preferences
    • In the host app passff.py:

[defaults]


Describe objectively your problem

I was getting the standard connecting error described under Troubleshooting. The debugging steps described there didn't turn up anything unusual.

But I noticed that the shebang in passff.py was hard-coding the path to the pyenv shim for python3 -- i.e., something like #!/Users/username/.pyenv/shims/python3. When I tried to execute passff.py with that shebang, I got errors indicating that the wrong interpreter was being used: the import statements at the beginning of the file were all erroring out.

Changing the shebang to #!/usr/bin/env python3 fixed everything, and I'm now a happy passff user.

Should #!/usr/bin/env python3 be the default shebang for macOS? Have I done something wrong by changing that?

pletcher avatar May 03 '22 20:05 pletcher

I had exactly the same problem! changing to system-python #!/usr/bin/python3 worked for me. I think in my pyenv global python are some missing dependencies...

gwbrck avatar Jun 13 '22 08:06 gwbrck

Same issue here in 2023. Changed the path to #!/usr/bin/env python3 and finally got it working.

victor-marino avatar Feb 13 '23 12:02 victor-marino

I don't understand why you would want to use a different python version than the one that you can find using which python3 (which is what the install script currently does). I think, instead of changing PassFF's install scripts, you should rather investigate why your system returns /Users/username/.pyenv/shims/python3 on which python3 if that's not really the Python executable you prefer.

tuxor1337 avatar Feb 13 '23 15:02 tuxor1337

I second to '#!/usr/bin/env python3'. In *BSD, python packages which are not in base are installed into /usr/local/bin while base in /usr/bin. The env command could handle this condition.

yjqg6666 avatar Jan 26 '24 01:01 yjqg6666