I am working in a SAS Viya 3.5 environment and am trying to get the Open Source Node from model managers pointing to the correct Python. It keeps defaulting to Python2.7 but should be Python3.6. I have updated my LD_LIBRARY_PATH and PATH with the Python directories and still it is reverting to Python 2.7. The PATH and LD_LIBRARY_PATH are both showing the correct Python version.
Here is what I have at this point:
The code is
import os
print(os.environ)
import sys
print(sys.path)
print("Hello World")
The output is:
{'SASDEPLOYID': 'viya', 'SAS_LAUNCHER_DEPLOYMENT_CONFIG_INSTANCE_ID': 'default', 'SAS_LAUNCHER_PATH_SEPARATOR': '/', '_JAVA_OPTIONS': '-Djava.awt.headless=true', 'TWO_TASK': 'ORACLE_SID', 'SHELL': '/bin/bash', 'DB2INSTANCE': 'cae64adm', 'CONSUL_HTTP_ADDR': 'https://localhost:8501', 'SAS_DEPLOYMENT_CONFIG_PATH': '/opt/sas/viya/config', 'SAS_SERVER_OS': 'linux', 'SAS_LAUNCHER_PROCESS_ID': '82f4758d-569d-43a3-bf1f-58ba06b1a384', 'COMPUTESERVER_RUN_PATH': '/opt/sas/viya/config/var/run/compsrv/default/61ed32f3-1be3-46f5-899b-b1236a8977db', 'JAVA_HOME': '/bin/java', 'COMPUTESERVER_TMP_PATH': '/saswork1', 'SAS_LAUNCHER_DEPLOYMENT_INSTALL_PATH': '/opt/sas/spre/home', 'IBM_DB_INCLUDE': '/cae64adm/sqllib/include', 'COMPUTESERVER_CONNECT_SCRIPT': '/opt/sas/viya/config/etc/connectserver/default/connectserver.sh', 'SAS_VAULT_URL': 'https://XXXXX.XX.com:8200', 'SAS_SERVICES_TOKEN': 'XXXXXXXXXXX-', 'SASINSTANCE': 'default', 'SASROOT': '/opt/sas/spre/home/SASFoundation', 'SASCFGPATH': '!SASROOT/sasv9.cfg, !SASROOT/sasv9_samples.cfg, !SASROOT/nls/u8/sasv9.cfg, !SASROOT/sasv9_local.cfg, /opt/sas/viya/config/etc/compsrv/default/sasv9.cfg, /opt/sas/viya/config/etc/compsrv/default/sasv9_deployment.cfg, /opt/sas/viya/config/etc/compsrv/default/sasv9_usermods.cfg', 'SAS_DEPLOYMENT_CONFIG_INSTANCE_ID': 'default', 'VAULT_CACERT': '/opt/sas/viya/config/etc/SASSecurityCertificateFramework/cacerts/trustedcerts.pem', 'SYBROOT': '/opt/sybase', 'SAP_JRE8': '/opt/sybase/shared/SAPJRE-8_1_078_64BIT', 'SASORA': 'V9', 'SASAUTOS': "( '!SASROOT/sasautos' )", 'ODBCSYSINI': '/opt/sas/access/odbc', 'USER': 'XXXXXX', 'SAS_CONSUL_URL': 'https://localhost:8501', 'LC__FASTMSG': 'false', 'ORACLE_HOME': '/u01/app/oracle/product/12.1.0.2/client_1', 'SHLVL': '4', 'LD_LIBRARY_PATH': '/opt/sas/access/unixODBC2.3.9/lib:/usr/local/easysoft/lib:/u01/app/oracle/product/12.1.0.2/client_1/lib:/opt/sas/access/netezza/lib64:/opt/sas/access/netezza/lib:/opt/sas/access/netezza/bin64:/usr/lib64:/opt/sybase/IQ-16_1/lib64:/opt/sas/spre/home/lib64/accessclients/lib:/opt/sas/access/odbc:/usr/lib64/snowflake/odbc/lib/:/opt/sas/spre/home/lib64:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.342.b07-1.el7_9.x86_64/jre/lib/amd64/server:/opt/sas/spre/home/SASFoundation/sasexe:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.342.b07-1.el7_9.x86_64/jre/lib/amd64:/opt/sybase/IQ-16_1/bin64:/opt/sybase/IQ-16_1:/cae64adm/sqllib/lib64:/cae64adm/sqllib/lib64/gskit:/cae64adm/sqllib/lib32:/usr/lib/lib_64:/opt/teradata/client/16.9/lib64:/opt/teradata/client/16.9/tbuild/lib64:/opt/teradata/client/16.9/tbuild/lib:/usr/lib:/bin/java/lib/amd64/server:/opt/sas/spre/home/SASFoundation/utilities/bin', 'SAS_LAUNCHER_SAS_SERVICES_URL': 'https://XXXX.XXX.com:443/', 'SYBASE': '/opt/sybase', 'SAS_LAUNCHER_CONSUL_URL': 'https://localhost:8501', 'SSL_CERT_FILE': '/opt/sas/viya/config/etc/SASSecurityCertificateFramework/cacerts/trustedcerts.pem', 'SSLPVTKEYTOKEN': 'XXXXXXX', 'config_home': '/opt/sas/viya/config/etc/compsrv/default', 'CLASSPATH': '/cae64adm/sqllib/java/db2java.zip:/cae64adm/sqllib/java/sqlj.zip:/cae64adm/sqllib/function:/cae64adm/sqllib/java/db2jcc_license_cu.jar:/cae64adm/sqllib/tools/clpplus.jar:/cae64adm/sqllib/tools/jline-0.9.93.jar:/cae64adm/sqllib/java/db2jcc.jar', 'COMPUTESERVER_DATA_PATH': '/opt/sas/viya/config/data/compsrv/default', 'SAS_LAUNCHER_SCRIPT_EXTENSION': 'sh', 'COMPUTESERVER_AUTOEXEC_PATH': '/opt/sas/viya/config/etc/compsrv/default/autoexec.sas', 'TK_OPTIONS': 'delaylaunch', '_': '/opt/sas/spre/home/SASFoundation/utilities/bin/compsrv', 'SAS_DEPLOYMENT_INSTALL_PATH': '/opt/sas/spre/home', 'EASYSOFT_UNICODE': 'YES', 'SASPREHOME': '/opt/sas/spre/home', 'SASCONFIG': '/opt/sas/viya/config', 'SAS_ODSG_CRENDER_PATH': '/opt/sas/spre/home/SASFoundation/lib/base/grodscrender', 'SAS_SETUP_NETWORK': 'done', 'CONSUL_CACERT': '/opt/sas/viya/config/etc/SASSecurityCertificateFramework/cacerts/trustedcerts.pem', 'ORAENV_ASK': 'NO', 'SAMPSRC': "( '!SASROOT/samples/base' '!SASROOT/samples/connect' '!SASROOT/samples/dmine' '!SASROOT/samples/ets' '!SASROOT/samples/graph' '!SASROOT/samples/hps' '!SASROOT/samples/hpstat' '!SASROOT/samples/iml' '!SASROOT/samples/or' '!SASROOT/samples/stat' )", 'SAS_HOSTNAME': 'XXX.XXX.com', 'NETEZZA': '/opt/sas/access/netezza', 'HOME': '/home/xxxxxx', 'NZ_ODBC_INI_PATH': '/opt/sas/access/odbc', 'COMPUTESERVER_HOST_FQDN': 'xxx.xxx.com', 'IQDIR16': '/opt/sybase/IQ-16_1', 'LANG': 'en_US', 'IBM_DB_DIR': '/cae64adm/sqllib', 'ODBCINSTINI': '/opt/sas/access/odbc/odbcinst.ini', 'SAS_SAN_DNS': 'XXXX XXXXX.XXX.com xxx.xxx.com localhost localhost4 localhost4.localdomain4 localhost.localdomain ', 'IBM_DB_LIB': '/cae64adm/sqllib/lib', 'sas_autoexec_deployment': '/opt/sas/viya/config/etc/compsrv/default/autoexec_deployment.sas', 'SAS_PATH_SEPARATOR': '/', 'DB2LIB': '/cae64adm/sqllib/lib', 'SAS_SCRIPT_EXTENSION': 'sh', 'HOST': 'apsld0135', 'SAS_LAUNCHER_SERVER_OS': 'linux', 'SAS_SAN_IP': '127.0.0.1 10.201.221.68', 'SAS_LAUNCHER_SAS_SERVICES_TOKEN': 'XXXXXXXX', 'SASHOME': '/opt/sas/spre/home', 'SAS_PAYLOAD_SOURCE': 'compsrv', 'SSLCERTLOC': '/opt/sas/viya/config/etc/SASSecurityCertificateFramework/tls/certs/tklauncher/default/certificate.pem', 'SAS_DEPLOYMENT_ID': 'viya', 'SAP_JRE8_64': '/opt/sybase/shared/SAPJRE-8_1_078_64BIT', 'COMPUTESERVER_LOCKDOWN_ENABLE': '0', 'LOGNAME': 'xxxxxx', 'SASMAKEHOMEDIR': '1', 'OLDPWD': '/home/XXXXX', 'TK_PATHLIST': '/opt/sas/spre/home/SASFoundation/sasexe:/opt/sas/spre/home/SASFoundation/utilities/bin', 'SAMPSIO': "( '!SASROOT/samples/base' '!SASROOT/samples/connect' '!SASROOT/samples/dmine' '!SASROOT/samples/ets' '!SASROOT/samples/graph' '!SASROOT/samples/hps' '!SASROOT/samples/hpstat' '!SASROOT/samples/iml' '!SASROOT/samples/or' '!SASROOT/samples/stat' )", 'SAS_INSTALL_ROOT': '/opt/sas/spre/home/SASFoundation', 'COMPUTESERVER_LOG_PATH': '/opt/sas/viya/config/var/log/compsrv/default', 'TK_Default_Options': '', 'COMPUTESERVER_LOG_TENANT': 'provider', 'PATH': '/usr/bin/python3.6:/usr/local/lib/python3.6/site-packages:/usr/local/lib64/python3.6/site-packages:/opt/sas/access/netezza/bin:/opt/teradata/client/16.9/lib64:/opt/sybase/IQ-16_1/bin64:/opt/sas/access/odbc:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/sas/spre/home/lib64:/opt/sas/spre/home/lib64/accessclients:/u01/app/oracle/product/12.1.0.2/client_1/bin:/cae64adm/sqllib/bin:/cae64adm/sqllib/adm:/cae64adm/sqllib/misc:/cae64adm/sqllib/pd:/cae64adm/sqllib/gskit/bin:/tmp', 'SAS_LAUNCHER_DEPLOYMENT_ID': 'viya', 'SAS_RABBITMQ_CREDENTIALS_TOKEN': 'XXXXXXXX', 'SASVIYAHOME': '/opt/sas/viya/home', 'INSTHOME': '/cae64adm/sqllib', 'SASROOTDIR': '/opt/sas/spre', 'SAS_SERVICES_URL': 'https://xxxxx.xxx.com:443/', 'SSLPVTKEYLOC': '/opt/sas/viya/config/etc/SASSecurityCertificateFramework/tls/certs/tklauncher/default/key.pem', 'sas_autoexec_usermods': '/opt/sas/viya/config/etc/compsrv/default/autoexec_usermods.sas', 'COMPUTESERVER_CAS_SERVICE': 'cas-shared-default', 'SASLOGROOT': '/opt/sas/viya/config/var/log/compsrv/default', 'COMPUTESERVER_SPOOL_PATH': '/opt/sas/viya/config/var/spool/compsrv/default/61ed32f3-1be3-46f5-899b-b1236a8977db', 'SAS_BIND_ADDR': '10.201.221.68', 'SASV9_OPTIONS': '-work /saswork1', 'DB2_HOME': '/cae64adm/sqllib', 'SAS_SERVICE_ADDR': 'xxxx.xxx.com', 'ODBCINI': '/opt/sas/access/odbc/odbc.ini', 'SSLCALISTLOC': '/opt/sas/viya/config/etc/SASSecurityCertificateFramework/cacerts/trustedcerts.pem', 'VAULT_ADDR': 'https://xxxx.xxx.com:8200/', 'ASDIR': '/opt/sybase/IQ-16_1', 'SAS_LAUNCHER_DEPLOYMENT_CONFIG_PATH': '/opt/sas/viya/config', 'PWD': '/opt/sas/viya/config/var/run/compsrv/default/61ed32f3-1be3-46f5-899b-b1236a8977db', 'IBM_DB_HOME': '/cae64adm/sqllib', 'ODBCHOME': '/opt/sas/access/unixODBC2.3.9'}
['/sasdwk/saswork1/SAS_work4DCB00016EE9_xxx.xxx.com/a45a3d12-e848-4583-bdc9-e316c1728ba1', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages']
Hello World
Hi @dlawto2
Do you mean Model Studio rather than Model Manager?
If your Viya environment is installed on Linux have you added the configuration for your python path to the sas-compsrv configuration file?
Here's the documentation discussing how to setup the open code node for Python in Viya 3.5
Thanks
Harry
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.