BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Seetha1
Fluorite | Level 6

Hi,

Can anybody help me with the procedure to install python packages in SAS Viya4? 

I want to use packages like tabula, PyPDF2 to extract information from PDF. But, these packages are not inbuilt in python. So, I have to install these packages manually. But, I don't know how to install it on python that is integrated on SAS VIYA 4. We have python version 3.8 on SAS Viya4

Thanks in advance for the help  

1 ACCEPTED SOLUTION

Accepted Solutions
WouterVdW
SAS Employee

Hi @sbxkoenk , @Seetha1 ,

 

actually the answer is in one  of the previous exchanges.
If you followed this article to enable Python in your SAS Viya :
https://communities.sas.com/t5/SAS-Communities-Library/Configuring-SAS-Viya-for-Python-Integration/t...
This is also the way to add extra Python packages.
By using the SAS Configurator for Open Source you can install extra packages .
You just add your Python package to this line in your $deploy/site-config/sas-pyconfig/change-configuration.yaml

- op: replace   # Packages that will be installed by PIP.
    path: /data/default_py.pip_install_packages    
    value: "sas_kernel matplotlib sasoptpy sas-esppy NeuralProphet scipy rpy2 Flask XGBoost TensorFlow pybase64 scikit-learn statsmodels sympy mlxtend Skl2onnx nbeats-pytorch ESRNN onnxruntime opencv-python zipfile38 json2 pyenchant nltk spacy gensim"

Regenerate your manifest file (site.yaml) and re-apply it.
If you launch a new instance of the sas-pyconfig job, this will add the extra packages

Hope this helps 

View solution in original post

12 REPLIES 12
JosvanderVelden
SAS Super FREQ
Did you do the installation?
If yes, have you installed python and swat?
Seetha1
Fluorite | Level 6

No, we haven't installed SWAT. But Python is installed.

Seetha1
Fluorite | Level 6

We have followed this link to configure python in SAS Viya4 environment.

https://communities.sas.com/t5/SAS-Communities-Library/Configuring-SAS-Viya-for-Python-Integration/t...

Now, we want to know how we can install additional python packages like - tabula and pypdf2. We need this in order to process pdf files.

Please find the screen shots of the packages that we have installed in the attached file and please guide us how we can install the above mentioned packages.

Seetha1
Fluorite | Level 6

Hi, 

I didn't get a solution to install the python packages- tabula and pypdf2. Please help me with a solution

sbxkoenk
SAS Super FREQ

@WouterVdW ... can you help?

 

Koen

WouterVdW
SAS Employee

Hi @sbxkoenk , @Seetha1 ,

 

actually the answer is in one  of the previous exchanges.
If you followed this article to enable Python in your SAS Viya :
https://communities.sas.com/t5/SAS-Communities-Library/Configuring-SAS-Viya-for-Python-Integration/t...
This is also the way to add extra Python packages.
By using the SAS Configurator for Open Source you can install extra packages .
You just add your Python package to this line in your $deploy/site-config/sas-pyconfig/change-configuration.yaml

- op: replace   # Packages that will be installed by PIP.
    path: /data/default_py.pip_install_packages    
    value: "sas_kernel matplotlib sasoptpy sas-esppy NeuralProphet scipy rpy2 Flask XGBoost TensorFlow pybase64 scikit-learn statsmodels sympy mlxtend Skl2onnx nbeats-pytorch ESRNN onnxruntime opencv-python zipfile38 json2 pyenchant nltk spacy gensim"

Regenerate your manifest file (site.yaml) and re-apply it.
If you launch a new instance of the sas-pyconfig job, this will add the extra packages

Hope this helps 

Seetha1
Fluorite | Level 6
Thank you for the guidance!
SASKiwi
PROC Star

I'd suggest opening a Tech Support track for this is your best option if you haven't already. I'm also moving this post to the Administration category for better visibility.

JuanS_OCS
Amethyst | Level 16

Since SAS Viya 4 comes in the shape of container images, they are not supposed to be modified.

The best option is to configure your SAS Viya 4 Python installation to point to a shared location on your Persistent Volume(s), where your modules will be installed and collected/pointed from the Python installation. If you manage to do this, you are good to go.

 

Else and technically speaking, you can modify the SAS images before deployed, but mind that, as soon as you, your SAS installation will not officially/fully supported anymore. Hence the reason why, while technically you can do this, it is not a healthy alternative. This is just one of the reasons. Another reason is the fact that, for every maintenance/update of SAS Viya, you would need to take the same steps to modify the image.

jacksmith1
Fluorite | Level 6

Hello,

I tried many ways to install python packages on SAS, steps you provided are very helpful as they reduced my pain. But I want to know one thing what is Generative AI? Is this relatable to SAS

 

 

Thanks

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 12 replies
  • 1180 views
  • 8 likes
  • 7 in conversation