BookmarkSubscribeRSS Feed
Calcite | Level 5

I am trying to configure saspy to connect to SAS On Demand for Academics via Pycharm on Mac OS 12.3.1 (Monterey). I have set up as directed here. See contents below.


oda = {'java' : '/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home',
#US Home Region 1
'iomhost' : ['','','',''],
#US Home Region 2
#'iomhost' : ['',''],
#European Home Region 1
#'iomhost' : ['',''],
#Asia Pacific Home Region 1
#'iomhost' : ['',''],
#Asia Pacific Home Region 2
#'iomhost' : ['',''],
'iomport' : 8591,
'authkey' : 'oda',
'encoding' : 'utf-8'

When running:

from saspy import SASsession
sas = saspy.SASsession()

I get the following error (no java error) with direction to run a few very long commands for diagnostic purposes.

The OS Error was:
No such file or directory
SAS Connection failed. No connection established. Double check your settings in file.

Long story short, when running the recommended commands in Terminal, all looks fine except:

-bash: command not found
-bash: command not found
-bash: command not found

Apparently is found? I'm out of my depth in solving this issue and I'm grateful for any insight!

SAS Employee

Hey, the error you got is about java not being found.

You show 

'java' : '/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home',

for java, which isn't java, so that's for sure the first problem. Also, I would issue

`import saspy'


`from saspy import SASsession'

Not sure where you saw that. Import the package.

And set the java config to an actual java.exe (java executable; can't tell if you are on windows or what). You provided an authkey config value; did you put your credentials in the authinfo file (that the next thing once you point to a real java). 

Then give it another try.

Calcite | Level 5

I'm on a Mac, which is usually the source of my problems, so I don't have java.exe. Any idea what I'm looking for?

SAS Employee

So, it won't have the windows .exe extension as part if it's filename, but Mac's can still have java installed, it's just the executable you need the path of. it would just be named java, in some directory where it's installed. I don't do 'I' things (Mac's are included in that), so I don't know where it would be installed or how you navigate the file system on that. I googled how to find the path to java on a mac and got this hit: along with plenty others. You ought to be able to find it on the filesystem if it's already installed, or just install it and then be able to see where it is.

Calcite | Level 5

the 'java' default key location for mac is '/usr/bin/java' so the line in your config file should be

'java' : '/usr/bin/java',


If for some reason you don't have java install I would install it via homebrew.



Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.


Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 


Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3 in conversation