BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
muhuri
Obsidian | Level 7
import saspy
import pandas as pd
sas = saspy.SASsession(cfgname='winlocal')
w_class = sas.sasdata("CLASS","SASHELP")
w_class.describe()
We failed in getConnection
The application could not log on to the server "localhost:0". Integrated Windows authentication failed.
SAS process has terminated unexpectedly. RC from wait was: 4294967290

SASIOConnectionTerminated                 Traceback (most recent call last)
Cell In[2], line 3
      1 import saspy
      2 import pandas as pd
----> 3 sas = saspy.SASsession(cfgname='winlocal')
      4 w_class = sas.sasdata("CLASS","SASHELP")
      5 w_class.describe()

File ~\AppData\Local\anaconda3\Lib\site-packages\saspy\sasbase.py:594, in SASsession.__init__(self, **kwargs)
    592         raise SASIONotSupportedError(self.sascfg.mode, alts=['IOM'])
    593 elif self.sascfg.mode == 'IOM':
--> 594     self._io = SASsessionIOM(sascfgname=self.sascfg.name, sb=self, **kwargs)
    595 elif self.sascfg.mode == 'COM':
    596     self._io = SASSessionCOM(sascfgname=self.sascfg.name, sb=self, **kwargs)

File ~\AppData\Local\anaconda3\Lib\site-packages\saspy\sasioiom.py:317, in SASsessionIOM.__init__(self, **kwargs)
    314 self._tomods1 = b"_tomods1"
    315 self.sascfg   = SASconfigIOM(self, **kwargs)
--> 317 self._startsas()
    318 self._sb.reconuri = None

File ~\AppData\Local\anaconda3\Lib\site-packages\saspy\sasioiom.py:582, in SASsessionIOM._startsas(self)
    580 if enc == '':
    581    self.sascfg.encoding = 'utf-8'
--> 582 ll = self.submit("options svgtitle='svgtitle'; options validvarname=any validmemname=extend pagesize=max nosyntaxcheck; ods graphics on;", "text")
    583 self.sascfg.encoding = enc
    585 if self.pid is None:

File ~\AppData\Local\anaconda3\Lib\site-packages\saspy\sasioiom.py:992, in SASsessionIOM.submit(self, code, results, prompt, **kwargs)
    990    #return dict(LOG=log.decode(errors='replace'), LST='')
    991    logger.fatal(log.decode(errors='replace'))
--> 992    raise SASIOConnectionTerminated(Exception)
    993 except subprocess.TimeoutExpired:
    994    pass

SASIOConnectionTerminated: No SAS process attached. SAS process has terminated unexpectedly.
<class 'Exception'>
#sascfg_personal.py
import os
os.environ["PATH"] += ";C:\\Program Files\\SASHome\\SASFoundation\\9.4\\core\\sasext"

SAS_config_names=['winlocal']

default  = {'saspath'  : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8' }

winlocal = {'java'      : 'C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe',  'encoding'  : 'windows-1252'}

Currently, I am unable to connect SASPy (Version: 5.103.0) to SAS (Version 9.04.01M7P080520) in Jupyter Lab (Version 4.2.5) on my Dell laptop (Windows 10), although the SASPy connection had been working fine until I updated my SAS license this week. 

 

On my second laptop (lenovo with Windows 10) with the same updated license, the SASPy connection to SAS in Jupyter lab has worked fine, as before. 

 

Any help toward the SASPy connection issue with SAS (as referred to Dell laptop above)  will be highly apprreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
muhuri
Obsidian | Level 7

The SAS Technical Support Expert has resolved the issue.

All I had to do is make the necessary change to my hosts file in C:\Windows\System32\drivers\etc, as documented in the following SAS KB article:

https://sas.service-now.com/csm?id=kb_article_view&sysparm_article=KB0036466.

Note that while the KB article above does not specifically mention SASPy, the issue and resolution is the same. 

Thanks,

 

 

View solution in original post

2 REPLIES 2
joeFurbee
Community Manager

Hi @muhuri,

I got this from our dev:

It looks like it is something with Integrated Windows Authentication (IWA) not working correctly on their Dell laptop.

 

My first thought is to have them check to see if IWA is working outside of SASPY, for example, they could follow these instruction (starting at 3 and 4): https://go.documentation.sas.com/doc/en/bicdc/9.4/bisecag/n1d1zo1jsf2o0en1ehu4c4simfky.htm#n1p1g1fi…

 

They're getting  Windows machine set up in the meantime to investigate further. I'll keep you posted.


Join us for SAS Community Trivia

SASBowl LVI, LLMs and SAS Coding
Wednesday, November 19, 2025 at 10 am ET.
muhuri
Obsidian | Level 7

The SAS Technical Support Expert has resolved the issue.

All I had to do is make the necessary change to my hosts file in C:\Windows\System32\drivers\etc, as documented in the following SAS KB article:

https://sas.service-now.com/csm?id=kb_article_view&sysparm_article=KB0036466.

Note that while the KB article above does not specifically mention SASPy, the issue and resolution is the same. 

Thanks,

 

 

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 551 views
  • 0 likes
  • 2 in conversation