Jennifer88huang commented on a change in pull request #5531: Documentation updates, mainly for Python API URL: https://github.com/apache/pulsar/pull/5531#discussion_r341593357
########## File path: site2/docs/functions-develop.md ########## @@ -35,6 +35,20 @@ def process(input): ``` For complete code, see [here](https://github.com/apache/pulsar/blob/master/pulsar-functions/python-examples/native_exclamation_function.py). +Note that functions can be written in python2 or python3, but pulsar +currently only looks for "python" as the interpreter to execute them. + +A recent Ubuntu system may have only "python3" but not "python", in which +case functions will fail to start. As a workaround you can create a symlink, but beware this has some +[risks](https://askubuntu.com/questions/320996/how-to-make-python-program-command-execute-python-3#answer-475815): + +```bash +sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 +``` + +If you choose to do this, be careful not to install any other package which +depends on "python" (2.x) Review comment: > Note > You can write Pulsar Functions in python2 or python3. However, Pulsar only looks for `python` as the interpreter. > If you're running Pulsar Functions on Ubuntu system that only supports `python3`, you might fail to start the functions. In this case, you can create a symlink. However, such action has potential [risks](https://askubuntu.com/questions/320996/how-to-make-python-program-command-execute-python-3#answer-475815). ```bash sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 ``` > If you create a symlink, you'd better not install any other package that depends on "python" (2.x). ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
