Closed su35 closed 3 years ago
Hey @su35, that's an easy one. On windows you can't simply code single backslashes in file system paths, because python treats them as escape sequences when followed by a number of other characters. The error is that it can't find java, and that's because the path is wrong, because backslash b, and others turn into other characters, making the path wrong. So, either use double backslashes in your windows paths, or add the 'r' prefix to the string to make it not use backslashes as an escape character.
You can see the error with what youspecified: C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jrin\java.exe C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jr[e\b]in\java.exe See how the \b (backspace), removed the 'r' before it, as well as itself, leaving jrin instead of jre\bin?
#So, you can code either of these to fix this error in python:
winlocal = {'java' : r'C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin\java.exe',
winlocal = {'java' : 'C:\\Program Files\\SASHome\\SASPrivateJavaRuntimeEnvironment\\9.4\\jre\\bin\\java.exe',
Tom
Thanks
Was that all that was wrong? Are you up and running?
I assume you've fixed that string and you're up and running. That's all that was needed for this error. If you have any other issue, just let me know! Thanks, Tom
import saspy sas = saspy.SASsession()
Using SAS Config named: winlocal The OS Error was: The system cannot find the file specified
SAS Connection failed. No connection established. Double check your settings in sascfg_personal.py file.
Attempted to run program C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jrin\java.exe with the following parameters:['C:\Program Files\SASHome\SASPrivateJavaRuntimeEnvironment\9.4\jre\x08in\java.exe', '-classpath', 'C:\Users\Jun\anaconda3\lib\site-packages\saspy\java\saspyiom.jar;C:\Users\Jun\anaconda3\lib\site-packages\saspy\java\iomclient\log4j.jar;C:\Users\Jun\anaconda3\lib\ .......
KeyError Traceback (most recent call last)