# Use PyPI packages with differing import names

Some Python PyPI package names do not match their import names. However, you can still import them into your Python steps.

# Using Magic Comments

When a package’s name doesn’t match the import name, you can specify the package name in a magic comment.

For example the google.cloud package exports bigquery, but you can still use it in your Python code steps in workflows:

# pipedream add-package google-cloud-bigquery

from google.cloud import bigquery

The special comment pipedream add-package <package name> will install the package into your workflow environment.

This is the new preferred way to import packages in Python code steps with mismatching module names.

Search PyPI Mappings

Alternatively, search for the PyPI package you're intending to use, and use the shorthand import module shortcut to import them into a Python step.

Using magic comments to import Python packages is the recommended approach to adding packages with different exported module names.
PyPI Package Name Import into Pipedream with