<?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>Question Re: Import sapdi in python operator with existing docker image in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaa-p/12453358#M4664174</link>
    <description>&lt;P&gt;Hi Sumit, I have just had a look at the DockerFiles that come with DI and com.sap.dsp.dsp-core-operators has a sapdi tag.
It was only a quick test, but with this Docker I was able to import sapdi in a Python operator &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FROM $com.sap.dsp.dsp-core-operators
RUN pip3.6 install --user numpy=="1.16.1"&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 02 Aug 2021 17:34:24 GMT</pubDate>
    <dc:creator>AndreasForster</dc:creator>
    <dc:date>2021-08-02T17:34:24Z</dc:date>
    <item>
      <title>Import sapdi in python operator with existing docker image</title>
      <link>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaq-p/12453355</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;
  &lt;P&gt;I already have one docker file grouped to the python operator. I have tried creating a new docker file for sapdi as mentioned in one of the questions but it's not working.&lt;/P&gt;
  &lt;P&gt;Docker File 1:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;# Use an official Python 3.6 image as a parent image 
FROM python:3.6
# Install python libraries
RUN pip install pandas
RUN pip install numpy
RUN pip install sklearn
RUN pip install catboost
RUN pip install pgeocode
RUN pip install hdfs==2.5.0
RUN pip install tornado==5.0.2
# Add vflow user and vflow group to prevent error 
# container has runAsNonRoot and image will run as root
RUN groupadd -g 1972 vflow &amp;amp;&amp;amp; useradd -g 1972 -u 1972 -m vflow
USER 1972:1972
WORKDIR /home/vflow
ENV HOME=/home/vflow&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;Tags for this Docker file:
{
    "python36": "",
    "tornado": "5.0.2",
    "hdfs": "2.5.0",
    "module": ""
}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Docker File 2:&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://answers.sap.com/questions/13285803/import-sapdi-library-in-python-operator-of-sap-di.html" target="test_blank"&gt;https://answers.sap.com/questions/13285803/import-sapdi-library-in-python-operator-of-sap-di.html&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;Have used this to build second docker file for sapdi.&lt;/P&gt;
  &lt;P&gt;Then have attached both the tags to the python operator, but it's not working.&lt;/P&gt;
  &lt;P&gt;Any help would be appreciated!&lt;/P&gt;
  &lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:23:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaq-p/12453355</guid>
      <dc:creator>former_member541625</dc:creator>
      <dc:date>2021-07-29T12:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Import sapdi in python operator with existing docker image</title>
      <link>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaa-p/12453356#M4664172</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;sumitguha&lt;/SPAN&gt; , You need to create a single DockerFile that contains all the libraries required for the code in your Python operator. It's been working well for me to base the DockerFile on an image provided by DI and to install the additional libraries. Something like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FROM $com.sap.sles.base
RUN pip3.6 install --user numpy=="1.16.1"&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Jul 2021 09:58:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaa-p/12453356#M4664172</guid>
      <dc:creator>AndreasForster</dc:creator>
      <dc:date>2021-07-30T09:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Import sapdi in python operator with existing docker image</title>
      <link>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaa-p/12453357#M4664173</link>
      <description>&lt;P&gt;Hello Andreas, &lt;/P&gt;&lt;P&gt;Thanks for your reply, have tried this but it's not working.&lt;/P&gt;&lt;P&gt;Below is the docker file &amp;amp; Tags in the JSON file:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;# Use an official Python 3.6 image as a parent image
FROM $com.sap.sles.base
# Install python libraries
RUN pip3.6 install --user numpy
RUN pip3.6 install --user pandas
RUN pip3.6 install --user sklearn
RUN pip3.6 install --user catboost
RUN pip3.6 install --user pgeocode
RUN pip3.6 install --user hdfs==2.5.0
RUN pip3.6 install --user tornado==5.0.2&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;{
    "python36": "",
    "tornado": "5.0.2",
    "hdfs": "2.5.0",
    "sapdi": "",
    "module": ""
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The build is complete of this docker file&lt;/P&gt;&lt;P&gt;But the code is showing the below error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;No module named 'sapdi'&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Aug 2021 13:51:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaa-p/12453357#M4664173</guid>
      <dc:creator>former_member541625</dc:creator>
      <dc:date>2021-08-02T13:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Import sapdi in python operator with existing docker image</title>
      <link>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaa-p/12453358#M4664174</link>
      <description>&lt;P&gt;Hi Sumit, I have just had a look at the DockerFiles that come with DI and com.sap.dsp.dsp-core-operators has a sapdi tag.
It was only a quick test, but with this Docker I was able to import sapdi in a Python operator &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FROM $com.sap.dsp.dsp-core-operators
RUN pip3.6 install --user numpy=="1.16.1"&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Aug 2021 17:34:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaa-p/12453358#M4664174</guid>
      <dc:creator>AndreasForster</dc:creator>
      <dc:date>2021-08-02T17:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Import sapdi in python operator with existing docker image</title>
      <link>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaa-p/12453359#M4664175</link>
      <description>&lt;P&gt;Thanks Andreas,&lt;/P&gt;&lt;P&gt;This is working fine.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 05:10:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/import-sapdi-in-python-operator-with-existing-docker-image/qaa-p/12453359#M4664175</guid>
      <dc:creator>former_member541625</dc:creator>
      <dc:date>2021-08-03T05:10:49Z</dc:date>
    </item>
  </channel>
</rss>

