Skip to Content
Technical Articles
Author's profile photo Andrew Lunde

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.

python -V

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.

jq -V

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.

-Andrew

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.

 

Assigned Tags

      12 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Andrew Lunde
      Andrew Lunde
      Blog Post Author

      See Also Ohad's blog post...

      https://blogs.sap.com/2020/12/28/extending-sap-business-application-studio-development-environment/

      -Andrew

      Author's profile photo Gaurav Chaudhar
      Gaurav Chaudhar

      Hey Andrew,

      Nice 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?

       

      Regards,

      Gaurav

      Author's profile photo Yuan Zhuang
      Yuan Zhuang
      Hey Gaurav,
      
      You can at first try to reinstall pip package by using this command in your terminal:
      
      curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
      python get-pip.py pip==19.3.1
      
      And then, use pip install to install your modules. I hope that could work for you.
      
      Regards,
      
      Yuan
      Author's profile photo Gaurav Chaudhar
      Gaurav Chaudhar

      Hi Yuan,

       

      Great. It worked 🙂 Thanks.

       

      Author's profile photo narayana lakshmi
      narayana lakshmi

      Hi Andrew,

      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!
      destdir: file:///home/user/.theia/workspace-storage/7da3e3aa6047faeaf214efd034371dfd/sap-partner-eng.bas-installer-extension
      destfile: file:///home/user/.theia/workspace-storage/7da3e3aa6047faeaf214efd034371dfd/sap-partner-eng.bas-installer-extension/bas_install_python.sh
      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 stdout:
      curl stderr:
      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%20Install%20Error

      Python Install Error

      Author's profile photo Andrew Lunde
      Andrew Lunde
      Blog Post Author

      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.

       

      -Andrew

      Author's profile photo narayana lakshmi
      narayana lakshmi

      Thanks Andrew !

      You are spot on. Immediately after posting my earlier comments, followed the steps in part 3 and it worked like charm !

      BR

      Lakshmi

      Author's profile photo Andrew Lunde
      Andrew Lunde
      Blog Post Author

      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.

      -A

      Author's profile photo narayana lakshmi
      narayana lakshmi

      True and BAS of course is not an open source tool 🙂

       

      BR

      Lakshmi

      Author's profile photo Rajesh Kumar Katkoori
      Rajesh Kumar Katkoori

      Hi Andrew,

      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.

      1. Unable to Debug: We have followed and added the Debug configuration and ran debug. During this we are getting below error. 

      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
      exec(code, run_globals)
      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>
      main()
      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>
      import ctypes
      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?

       

      Regards,

      Rajesh

       

      Author's profile photo Andrew Lunde
      Andrew Lunde
      Blog Post Author

      Business Application Studio has been completely rearchitected and I'm not sure that this blog's information still applies.  I'm looking into it.

      -Andrew

      Author's profile photo Rajesh Kumar Katkoori
      Rajesh Kumar Katkoori

      Hi Andrew,

      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?

      Regards,

      Rajesh