How to use a python package in an extension?

How do I import my python pip package into an extension, for example:

Notice this extension is able to import a method from the radiomics library. How do I accomplish the same with my pip module on PyPi?

I think these two posts will help you out! Which python package on PyPI are you looking to use in your extension?

Simplest (Really only recommended for packaged on PyPI that have wheels available):

More involved, but gets the external python package at time of building the extension and then the files are packaged together when building the extension package file:

Thanks James, the first method worked! I am using the collageradiomics python package.

1 Like