<?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: PROC FCMP python execution error - No module in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-FCMP-python-execution-error-No-module/m-p/789652#M252720</link>
    <description>&lt;P&gt;Your best chance might be to contact SAS tech support.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jan 2022 08:54:32 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2022-01-12T08:54:32Z</dc:date>
    <item>
      <title>PROC FCMP python execution error - No module</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FCMP-python-execution-error-No-module/m-p/789432#M252616</link>
      <description>&lt;P&gt;Hi Everyone ,&lt;/P&gt;
&lt;P&gt;I am trying to execute python code using PROC FCMP .&lt;/P&gt;
&lt;P&gt;This is my first time using PROC FCMP .&lt;/P&gt;
&lt;P&gt;When I execute the program I get an Import error stating that a module (pdfminer) I am using is not there.&lt;/P&gt;
&lt;P&gt;I know that when this error occurs in python the module is missing and we need to install it.&lt;/P&gt;
&lt;P&gt;Does anyone know where and how to install this module so that I can resolve this error?&lt;/P&gt;
&lt;P&gt;Do I need to use the pip install command?&lt;/P&gt;
&lt;P&gt;Please advise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached my code and error for your reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename t temp;
proc printto print=t;
run;
/* A basic example of using PROC FCMP to execute a Python function */
proc fcmp;
/* Declare Python object */
declare object py(python);
/* Create an embedded Python block to write your Python function */
submit into py;
def extractlink():
    "Output: mytable"
    from io import StringIO
    from pdfminer.converter import TextConverter
    from pdfminer.layout import LAParams
    from pdfminer.pdfdocument import PDFDocument
    from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
    from pdfminer.pdfpage import PDFPage
    from pdfminer.pdfparser import PDFParser
    import requests
    from bs4 import BeautifulSoup
    import pandas as pd
    links = []
    headline = []
    article_content=[]
    subset_links=[]
    page=requests.get('https://www.statecapture.org.za/site/media/statements')
    soup=BeautifulSoup(page.content,'html.parser')
    urls=soup.find_all("a",class_="text-uppercase")
    for a in soup.find_all("a",class_="text-uppercase", href=True):
        if a.text:
             links.append({
                'url':a['href'],
                'headline':a.text.replace('\xa0','')
            })
    mytable=pd.DataFrame(links)
    return mytable
endsubmit;

/* Publish the code to the Python interpreter */
rc = py.publish();

/* Call the Python function from SAS */
rc = py.call("extractlink");

/* Store the result in a SAS variable and examine the value */
SAS_Out = py.results["mytable"];
put SAS_Out=;
run;

proc printto;
run;
data _null_;
  infile t;
  input;
  put _infile_;
run;
filename t;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fcmperror.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67283i0BEFBAC14F1E5D1A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fcmperror.PNG" alt="fcmperror.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and Regards,&lt;/P&gt;
&lt;P&gt;Mohammad Umair Kazi&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 10:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FCMP-python-execution-error-No-module/m-p/789432#M252616</guid>
      <dc:creator>kaziumair</dc:creator>
      <dc:date>2022-01-11T10:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FCMP python execution error - No module</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FCMP-python-execution-error-No-module/m-p/789652#M252720</link>
      <description>&lt;P&gt;Your best chance might be to contact SAS tech support.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 08:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FCMP-python-execution-error-No-module/m-p/789652#M252720</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2022-01-12T08:54:32Z</dc:date>
    </item>
  </channel>
</rss>

