

#Python search for file install#
python3 -c "import sysconfig print(sysconfig.get_path('purelib', 'posix_home'))"Īs Antonio mentioned in his post you will need to install ipykernel package to be able to run Python code using Jupyter in SAP Business Application Studio. Now - that virtual environment env is activated - you should install Python packages into the “home” location, not into the “user” one. The built-in venv module in Python provides support for creating lightweight “virtual environments” with their own site directories, optionally isolated from system site directories. mkdir ~/projects/hanaml_demo & cd ~/projects/hanaml_demo it is located in the directory /home/user/projects/hanaml_demo. Let’s say my project in BAS is called hanaml_demo, ie. …is to use Python’s virtual environment for my Jupyter project. The way I approach this in a DevSpace, assuming Jupyter and Python extensions are installed… The problem with this location is it is not persisted between restarts of your BAS DevSpace. Python3 -c "import sysconfig print(sysconfig.get_path('purelib', 'posix_user'))" Python3 -c "import sysconfig print(sysconfig.get_paths('posix_user'))" If you used that approach, then you might find that by default all Python packages installed by you are going to a user location /home/user/.local/lib/python3.9/site-packages, as can be checked with the following commands: python3 -c "import sysconfig print(sysconfig.get_scheme_names())"

Some time ago my teammate Antonio Maradiaga published a post about Running a Jupyter notebook in SAP Business Application Studio with packages, like Python Machine Learning Client for SAP HANA.
