I want to install additional Python package on SAS Viya to be used on SAS Intelligent Decisioning Python code files.
But still encountering this error "ModuleNotFoundError"
![ltuala_0-1689033641256.png ltuala_0-1689033641256.png](https://communities.sas.com/t5/image/serverpage/image-id/85703iAAF0B1E032CBF90B/image-size/medium?v=v2&px=400)
Had tried to follow this blog post but skip some parts and follow sections I deemed necessary for my case. Configuring SAS Viya for Python Integration
Here are the steps I have done:
- Created the change-configuration.yaml on this path ../site-config/sas-pyconfig. The permission is set to 777 for both the file and the parent folder.
![ltuala_4-1689034395933.png ltuala_4-1689034395933.png](https://communities.sas.com/t5/image/serverpage/image-id/85707iDF5D9A7D572EEF01/image-size/medium?v=v2&px=400)
- Here is the content of the file:
Set the global.enabled and global.python_enabled to true
Added the additional package cx_Oracle to default_py.pip_install_packages
apiVersion: builtin
kind: PatchTransformer
metadata:
name: sas-pyconfig-custom-parameters
patch: |-
- op: replace
path: /data/global.enabled
value: "true"
- op: replace
path: /data/global.python_enabled
value: "true"
- op: replace
path: /data/global.r_enabled
value: "false"
- op: replace
path: /data/global.pvc
value: "/opt/sas/viya/home/sas-pyconfig"
- op: replace
path: /data/global.python_profiles
value: "default_py"
- op: replace
path: /data/global.r_profiles
value: "default_r"
- op: replace
path: /data/default_py.configure_opts
value: "--enable-optimizations"
- op: replace
path: /data/default_r.configure_opts
value: "--enable-memory-profiling --enable-R-shlib --with-blas --with-lapack --with-readline=no --with-x=no --enable-BLAS-shlib"
- op: replace
path: /data/default_py.cflags
value: "-fPIC"
- op: replace
path: /data/default_r.cflags
value: "-fPIC"
- op: replace
path: /data/default_py.pip_install_nobinary
value: "Prophet sas_kernel"
- op: replace
path: /data/default_py.pip_install_packages
value: "Prophet 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 cx_Oracle"
- op: replace
path: /data/default_py.python_signer
value: https://keybase.io/ambv/pgp_keys.asc
- op: replace
path: /data/default_py.python_signature
value: https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz.asc
- op: replace
path: /data/default_py.python_tarball
value: https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz
- op: replace
path: /data/default_r.r_tarball
value: https://cloud.r-project.org/src/base/R-4/R-4.2.2.tar.gz
- op: replace
path: /data/default_r.packages
value: "dplyr jsonlite httr tidyverse randomForest xgboost forecast"
target:
version: v1
kind: ConfigMap
name: sas-pyconfig-parameters
3. Edit the kustomization.yaml to include this file (last line).
![ltuala_5-1689035359891.png ltuala_5-1689035359891.png](https://communities.sas.com/t5/image/serverpage/image-id/85708iBDF32DE45C6E3473/image-size/medium?v=v2&px=400)
4. Run the command:
kubectl create job sas-pyconfig-adhoc -n sas-viya --from cronjob/sas-pyconfig
![ltuala_6-1689035600893.png ltuala_6-1689035600893.png](https://communities.sas.com/t5/image/serverpage/image-id/85709i476130495DDBF8FD/image-size/medium?v=v2&px=400)
5. Then did the testing on SAS Studio.
![ltuala_0-1689033641256.png ltuala_0-1689033641256.png](https://communities.sas.com/t5/image/serverpage/image-id/85703iAAF0B1E032CBF90B/image-size/medium?v=v2&px=400)
Currently stuck on this issue, I might have missed important steps. Thanks in advance.