0

I am currently using a python script in my Azure pipeline

Import data as Dataframe  -->  Run Python Script  -->  Export Dataframe

My script is developed locally and I get import errors when trying to import tensorflow... No problem, guess I just have to add it to environment dependencies somewhere -- and it is here the documentation fails me. They seem to rely on the SDK without touching the GUI, but I am using the designer.

I have at this point already build some enviroments with the dependencies, but utilizing these environments on the run or script level is not obvious to me.

It seems trivial, so any help as to use modules is greatly appreciated.

LeOverflow
  • 301
  • 1
  • 2
  • 16
  • Hi Did you get a chance to check out below answer? Please let me if it helped you to fix this issue – Levi Lu-MSFT Feb 25 '21 at 02:24
  • Your answer indeed was helpful -- I have now granted it an upvote, but I would prefer a solution which worked with the environment variables. – LeOverflow Feb 25 '21 at 10:28

1 Answers1

1

To use the modules that are not preinstalled(see Preinstalled Python packages). You need to add the zipped file containing new Python packages on Script bundle. See below description in the document:

To include new Python packages or code, connect the zipped file that contains these custom resources to Script bundle port. Or if your script is larger than 16 KB, use the Script Bundle port to avoid errors like CommandLine exceeds the limit of 16597 characters.

  • Bundle the script and other custom resources to a zip file.
  • Upload the zip file as a File Dataset to the studio.
  • Drag the dataset module from the Datasets list in the left module pane in the designer authoring page.
  • Connect the dataset module to the Script Bundle port of Execute Python Script module.

Please check out document How to configure Execute Python Script.

For more information about how to prepare and upload these resources, see Unpack Zipped Data

You can also check out this similar thread.

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43