You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/10/11 14:53:27 UTC

[GitHub] [pulsar] candlerb opened a new issue #5369: "#!/usr/bin/env python" doesn't work on Ubuntu 18.04 / python3

candlerb opened a new issue #5369: "#!/usr/bin/env python" doesn't work on Ubuntu 18.04 / python3
URL: https://github.com/apache/pulsar/issues/5369
 
 
   **Describe the bug**
   
   Ubuntu 18.04 comes with python3 only by default, so scripts which try to start "python" don't work.
   
   **To Reproduce**
   
   On Ubuntu 18.04, try to start the sql worker:
   
   ```
   $ bin/pulsar sql-worker run
   /usr/bin/env: ‘python’: No such file or directory
   ```
   
   Tracing shows that sql-worker runs `lib/presto/bin/launcher` which runs `lib/presto/bin/launcher.py` whose first line is `#!/usr/bin/env python`
   
   The underlying problem is: Ubuntu 18.04 comes with python3 only by default.  In the case of Ubuntu (and presumably Debian), "python" means python2, which is very shortly [end-of-life](https://pythonclock.org).
   
   Symlinking python3 to python is heavily discouraged, as it can badly break things which depend on python2.
   
   It's not clear whether sql worker is compatible with python3 or not, but a workaround is to patch the files:
   
   ```
   sed -i'' -e 's@^#!/usr/bin/env python$@#!/usr/bin/env python3@' $(grep -lR '^#!/usr/bin/env python$' .)
   ```
   
   **Expected behavior**
   sql worker should start
   
   **Desktop (please complete the following information):**
    - OS: Ubuntu 18.04
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services