community
cancel
Showing results for 
Search instead for 
Did you mean: 

Dev Space

Customize & extend the power of Alteryx. SDKs, APIs, custom tools, and more!
#SANTALYTICS

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More
SOLVED

Installing packages from corporate PyPi mirror?

Meteoroid

Using the python node, normally you would use 

Package.installPackages([...])

The company firewall I work behind blocks pypi but my company hosts a pypi mirror at, for example, https://pypi.mirror.corpintra.net/root/pypi.  In pip, you'd do something like

pip install -i https://pypi.mirror.corpintra.net/root/pypi <package-name> --trusted-host pypi.mirror.corpintra.net

Does Package.installPackages have a similar way to use an alternative pypi source?

Alteryx
Alteryx

The YXI package uses built-in options for installing packages and are not configurable.  You should, however, be able to modify the pypi (package-index) source path by creating a pip.ini configuration file: https://pip.readthedocs.io/en/stable/user_guide/#config-file.  I have been able to do that on my setup to test out certain pip settings, so hopefully you will be able to do something similar.

Meteoroid

This only works for running alteryx workflows locally, right?  How would I translate such a solution to workflows I publish to my company's Alteryx Server (for example, ones I plan to schedule)?

Alteryx
Alteryx

That is correct, the pip.ini file will only be able to affect your local pip installs.  To affect this on an Alteryx Server, you would have to request that the server admin create a pip.ini configuration in the %APP_DATA%/pip path.

Highlighted
Meteoroid

I did some more reading about pip parameters and it seems like an alternative to using pip.ini is to set environment variables.  It looks like if you do

os.environ['PIP_INDEX_URL'] = "https://pypi.mirror.corpintra.net/root/pypi"
os.environ['PIP_TRUSTED_HOST'] = "pypi.mirror.corpintra.net"
os.environ['PIP_USER'] = '1'

you can accomplish the same effect as modifying the pip.ini file.