<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Running Python on SAS on Demand in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Running-Python-on-SAS-on-Demand/m-p/902563#M356692</link>
    <description>&lt;P&gt;Lex, I don't know this for certain but I suspect Python is not generally available for SAS code in this environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With over a quarter million active users, the SAS OnDemand for Academics environment has to limit the ability to call out to external processes, including things like Python.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In an environment where you had some control, &lt;A href="https://go.documentation.sas.com/doc/en/bicdc/9.4/biasag/n1mquxnfmfu83en1if8icqmx8cdf.htm" target="_self"&gt;you could set these environment variables in your SAS program&lt;/A&gt; to known values:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;options set=MAS_PYPATH="path-to-python"
        set=MAS_M2PATH="your-sas-root/SASFoundation/9.4/misc/tkmas/mas2py.py";
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then you would also need to be able to install (or ask for) the Python packages you need. numpy, pandas, etc are likely not in a vanilla environment, so an admin needs to make those packages available in order for you to do anything useful. Given the governance needed for SAS OnDemand for Academics, I'm thinking these use cases are out of scope.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2023 17:22:37 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2023-11-10T17:22:37Z</dc:date>
    <item>
      <title>Running Python on SAS on Demand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-Python-on-SAS-on-Demand/m-p/902485#M356668</link>
      <description>&lt;P&gt;I know I can connect SAS on Demand with SASPy.&lt;/P&gt;&lt;P&gt;But I like to to test SAS code that uses Python functions created with PROC FCMP at SAS on Demand. It looks like MAS_PYPATH is not set in SAS on Demand.&lt;/P&gt;&lt;DIV class=""&gt;Is there a way to do this?&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Thanks,&lt;/DIV&gt;&lt;DIV class=""&gt;Lex&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: masPublish encountered a failure.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Foreign Language Compilation messages:&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Python compile: ERROR: MAS_PYPATH environment variable is undefined.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Python compile: ERROR: tkmaspyPublish encountered a failure in tkmaspyConnect, rc=0x803FC26A.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Unable to publish program for foreign language execution.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Error reported in function 'python:PUBLISH' in statement number 6 at line 21 column 6.&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 12:53:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-Python-on-SAS-on-Demand/m-p/902485#M356668</guid>
      <dc:creator>lexjansen</dc:creator>
      <dc:date>2023-11-10T12:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Running Python on SAS on Demand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-Python-on-SAS-on-Demand/m-p/902563#M356692</link>
      <description>&lt;P&gt;Lex, I don't know this for certain but I suspect Python is not generally available for SAS code in this environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With over a quarter million active users, the SAS OnDemand for Academics environment has to limit the ability to call out to external processes, including things like Python.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In an environment where you had some control, &lt;A href="https://go.documentation.sas.com/doc/en/bicdc/9.4/biasag/n1mquxnfmfu83en1if8icqmx8cdf.htm" target="_self"&gt;you could set these environment variables in your SAS program&lt;/A&gt; to known values:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;options set=MAS_PYPATH="path-to-python"
        set=MAS_M2PATH="your-sas-root/SASFoundation/9.4/misc/tkmas/mas2py.py";
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then you would also need to be able to install (or ask for) the Python packages you need. numpy, pandas, etc are likely not in a vanilla environment, so an admin needs to make those packages available in order for you to do anything useful. Given the governance needed for SAS OnDemand for Academics, I'm thinking these use cases are out of scope.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 17:22:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-Python-on-SAS-on-Demand/m-p/902563#M356692</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2023-11-10T17:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Running Python on SAS on Demand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Running-Python-on-SAS-on-Demand/m-p/902613#M356711</link>
      <description>&lt;P&gt;Thanks, Chris, I get that. SAS OnDemand is really a vanilla SAS environment to get 'a taste of SAS'.&lt;/P&gt;&lt;P&gt;I appreciate your detailed response.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 01:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Running-Python-on-SAS-on-Demand/m-p/902613#M356711</guid>
      <dc:creator>lexjansen</dc:creator>
      <dc:date>2023-11-11T01:43:34Z</dc:date>
    </item>
  </channel>
</rss>

