---
title: Install and update Python packages behind a proxy
slug: install-10x/install-and-update-python-packages-behind-a-proxy
docTags: 
createdAt: 2025-12-15T08:46:36.816Z
---

Pip, a package manager for Python, requires internet access when installing and updating packages from PyPI. If the Swimlane server is behind an outbound HTTP proxy server, then pip can be configured to connect through the proxy server in various ways.

- Using the --proxy command-line option to specify a proxy in the form \[user\:password@]proxy.url\:proxy\_port. The use of "user\:password@" is optionally if the proxy requires authentication.
- By setting the standard environment-variables http\_proxy, https\_proxy, and no\_proxy
- Using proxy in a Config file

# Using Command-line

For a single package install or update you can use the pip built-in proxy flag.

## Install

**pip install --proxy=http\://\[user\:password@]proxy\_url\:proxy\_port \<package\_name>**

## Upgrade

**pip install -U --proxy=http\://\[user\:password@]proxy\_url\:proxy\_port \<package\_name>**

# Using Environment Variables

For multiple package installs and updates, you can set environment variables and use the pip command as you normally would.

# Using Config

Pip allows you to set all command-line option defaults in a standard ini style config file, pip.ini.

1. To locate the pip.ini, follow the Config file link.
2. Edit pip.ini file and add
   \[global]
   proxy = http\://\[user\:password@]proxy\_url\:proxy\_port

## Within Swimlane

From Swimlane Admin Console, go to "Config" tab. In the "Config" tab, you will find the option "Upload Pip Config for API and Tasks":

![](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ODEwMjkwNzE2MCwiZG9tYWluIjoic3dpbWxhbmUuZnJlc2hkZXNrLmNvbSIsImFjY291bnRfaWQiOjI3NTUzNn0.oQC0IIEeYSRpKfGYK1aXDXuatvl5weESkdsPAxXyemA)

Check the "Upload Pip Config for API and Tasks" option, and upload a pip.conf file with the following content:

:::BlockQuote
\[global]

\# proxy settings
proxy = http\://proxy\_url\:proxy\_port
:::

When using a proxy, the following sample code can be used for accessing the internet within the Swimlane Python Script task

:::BlockQuote
import os

\# proxy settings
os.environ\['http\_proxy'] = http\://\[user\:password@]proxy\_url\:proxy\_port
os.environ\['https\_proxy'] = https\://\[user\:password@]proxy\_url\:proxy\_port
:::

Note: If you run into SOCKS error then use all\_proxy=http\://username\:password\@proxy\_url\:proxy\_port
