Installing private Python packages

Once you have signed up for a Gemfury account and uploaded a few packages, you can install them via command-line, or with requirements.txt.

Your secret Repository URL

The secret repository URL is the PyPI endpoint for your Gemfury account and packages. Do not share this URL to keep your account private.

Your PyPI URL has the following format:

You can find your Repo URL via the dashboard following these steps.

Building and uploading packages

After using one of many guides on the web about creating a Python package, you can now upload it to Gemfury. Use the "+Upload" button in the dashboard or the following command:

$ curl -F package=@pkg-0.0.1.tgz

Unfortunately, due to HTTP encoding issues in Python's distutils, we are not able to support python sdist upload method of uploading packages at this time. The problem relates to improper line termination that does not conform to the HTTP specification. Please use one of the other supported methods.

Install modules via command-line

Once you have your Repository URL, you can install packages via the following command:

pip install py-sample --extra-index-url <Repo-URL>

We use --extra-index-url to allow pip to keep the original Index URL. This allows pip to implicitly install public packages that your private package may depend on.

Install modules via requirements.txt

Add the --extra-index-url option at the top of your requirements.txt:

--extra-index-url <Repo-URL>

Test it out by running:

pip install -r ./requirements.txt