Pip install specific versions of python libraries

Not sure if there is a way to install specific versions of a 3rd party library in Python? I’ve recently had a breaking change with the latest pandas library, and it has impacted some of my automations.

I understand that pinning versions is already available in node.js. If there’s another way specify the versions of my dependencies in a workflow, that will be really helpful.

Thanks!

1 Like

@pipedream any updates on this?

@pipedream hoping there’s a way to make this possible soon

Just raised this with the team, and I opened up an issue to track it: [FEATURE] Pin specific versions of Python packages · Issue #7509 · PipedreamHQ/pipedream · GitHub

1 Like

This should be done. You can pin a package to a specific version using this syntax:

# pipedream add-package pandas==2.0.0
import pandas

def handler(pd: "pipedream"):
    return pandas.__version__

In general:

# pipedream add-package <package>==<version>
import <package>

A couple of caveats that we’re working to address:

  • You cannot use different versions of the same package in the same workflow (even across multiple steps). This means if you’re referencing an unpinned package in multiple steps, you’ll need to update those to use the same, specific version. Some background: in the container where your workflows run, we spin up a single Python process to execute Python steps. By design, a single Python process cannot run multiple versions of the same package. We have a proposal in mind to address this.
  • When you edit a workflow, we spin up a container where your workflow runs when tested. If you test a step, modify the version of a Python package, then test the step immediately after, it may fail on the new version. You’ll get a new test container automatically after ~5-10 minutes, and it should work after that. Subsequent tests should work just fine if you’re not switching versions of packages. We’re also planning to address this.

Let me know if this works OK for y’all or if you see any issues!