Xtending Business Application Studio : 4 of 3
Since my last installment of this blog post series, I’ve learned how to publish Theia extensions! You can find out how to publish your own by getting started with this wiki page.
When you publish extensions to the Open-VSX marketplace, they will appear in the EXTENSIONS plugin within BAS. So for a little encore, I created an extension that makes it even easier to perform the steps mentioned in blog post 1 (NOTROOT) and blog post 3 (Python).
Search for an extension that starts with Partner and select the SAP Partner Engineering BAS Installer extension.
Now that the installer extension is installed, it provides 2 new commands that you can find in the View -> Find Command… function. First, to install Python by typing BAS: Install Python. Open up the output and select the Python Installer occurrence to see that it completed without issues. Then verify that python is available by opening a new terminal and issuing the command.
Second, install NOTROOT by typing BAS: Install NOTROOT. Open up the output and select the NOTROOT Installer occurrence to see that it completed without issues. Then verify that NOTROOT is available by opening a new terminal and issuing the command.
Currently there is no uninstall option for Python or NOTROOT, but by packaging what is effectively some scripts into an extension, I can make it way easier to install these “and other” tools into BAS.
Let me know if you have and questions or issues by leaving me a question below or better yet, asking it on the SAP community.
|Partners: If you have a question, click here to ask it in the SAP Community . Be sure to tag it with Partnership and leave your company name in the question so that we can better assist you.|
See Also Ohad's blog post...
I was able to perform these step and could run python scripts as well. However, when I do PIP Install, the command always runs into error. I even tried nonroot but no luck.
Any idea if it has something to do with user privilages? or anything else?
Great. It worked 🙂 Thanks.
Great blog ! Tried the steps for NOTROOT and PYTHON and we are getting the following error in the output and python is not installed in BAS. Any inputs will be great !
Python Installer Begins!
shellcmd: curl -s -L -o file:///home/user/.theia/workspace-storage/7da3e3aa6047faeaf214efd034371dfd/sap-partner-eng.bas-installer-extension/bas_install_python.sh https://raw.githubusercontent.com/SAP-samples/hana-python-securestore/master/tools/bas_install_python.sh
curl error: Error: Command failed: curl -s -L -o file:///home/user/.theia/workspace-storage/7da3e3aa6047faeaf214efd034371dfd/sap-partner-eng.bas-installer-extension/bas_install_python.sh https://raw.githubusercontent.com/SAP-samples/hana-python-securestore/master/tools/bas_install_python.sh
Python Installer Finished!
Python Install Error
Check out part 3 of this series. The python installer was separate. Keep in mind that this blog post is getting quite dated and only python versions available at the time were included in the python installations.
Thanks Andrew !
You are spot on. Immediately after posting my earlier comments, followed the steps in part 3 and it worked like charm !
No problem. As an aside, I've tried pushing on the BAS team to consider building in Python as a default installed language, but I think they're hampered by the fact that once they do, the GoLang, Rust, Swift, Lisp(ok, maybe not Lisp) advocates will want to join the party as well and it could get out of control.
True and BAS of course is not an open source tool 🙂
Thanks for your Blog. We have followed the steps and able to install and run the 'Hello world' File in BAS. How ever when we are facing two issues.
user: my_python $ /usr/bin/env /usr/bin/python3 /home/user/.vscode/extensions/ms-python.python-2022.18.2-universal/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 38663 -- /home/user/projects/my_python/.vscode/launch.json
Traceback (most recent call last):
File "/home/user/python_3_9_2/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/user/python_3_9_2/lib/python3.9/runpy.py", line 87, in _run_code
File "/home/user/.vscode/extensions/ms-python.python-2022.18.2-universal/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/__main__.py", line 91, in <module>
File "/home/user/.vscode/extensions/ms-python.python-2022.18.2-universal/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/__main__.py", line 18, in main
from debugpy.launcher import debuggee
File "/home/user/.vscode/extensions/ms-python.python-2022.18.2-universal/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/launcher/debuggee.py", line 6, in <module>
File "/home/user/python_3_9_2/lib/python3.9/ctypes/__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ImportError: libffi.so.6: cannot open shared object file: No such file or directory
2. Notebook Issue: We have added the note book file and try to execute the line. During this we are getting below error. We tried to execute the reinstall command but did not worked.
Running cells with '/usr/bin/python3' requires ipykernel package. Run the following command to install 'ipykernel' into the Python environment. Command: '/usr/bin/python3 -m pip install ipykernel -U --user --force-reinstall'
Could you please help here on what was wrong?
Business Application Studio has been completely rearchitected and I'm not sure that this blog's information still applies. I'm looking into it.
Thanks for looking into it.
We are exploring to do Python developments in BTP. During this we saw your blog and followed it. We still stuck here and could not figured it out on fixing the issue. Could you please help here and also share any other way we can do the python and Jupyter setup?