Installing packages from corporate PyPi mirror?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Printer Friendly Page
- Mark as New
- Subscribe to RSS Feed
- Permalink
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?
Solved! Go to Solution.
- Mark as New
- Subscribe to RSS Feed
- Permalink
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.
- Mark as New
- Subscribe to RSS Feed
- Permalink
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)?
- Mark as New
- Subscribe to RSS Feed
- Permalink
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.
- Mark as New
- Subscribe to RSS Feed
- Permalink
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.
