Working with private channels using third-party tools#

In order to access private channels via third-party tools (such as pip, Twine, or R), you must have a user token. For more information, see Tokens.

Python packages#


Twine is a popular tool for uploading Python packages to PyPI-like repositories. Run the following command to upload Python packages:

twine upload --repository-url http://<DOMAIN>/api/repo/<CHANNEL>
<PACKAGE> -u <TOKEN> -p x-auth-token


twine upload --repository-url six-1.13.0-py2.py3-none-any.whl -u 46e98d3dbf2378bb26e2107867652ee734eb098ea5b96f35 -p x-auth-token

If the token is incorrect, you will receive a 401 error message.

Please refer to the Twine package documentation to learn how to configure your username and password via the configuration file or environment variables.


Similar to pip, Anaconda Server supports user authentication using Basic Authentication. The following is the proper format for installing pip packages:

pip install --trusted-host <DOMAIN> --index-url
http://<TOKEN>:x-auth-token@<DOMAIN>/api/repo/<CHANNEL>/simple <PACKAGE>


x-auth-token is not a placeholder, but is used as the actual password for Basic Authentication.


pip install --trusted-host --index-url
http://46e98d3dbf2378bb26e2107867652ee734eb098ea5b96f35:[email protected]/api/repo/alex-pip/simple six

Make sure to add a trusted host.

Please refer to the pip documentation to learn how to configure the index URL via the configuration file or environment variables.

R packages#


Since there is no standard tool for uploading R packages, you can use either the UI or API directly. Run the following command to upload R packages:

curl -v -F filetype=cran_source_package -F content=@<FILENAME>
http://<DOMAIN>/api/repo/<CHANNEL> -H"X-Auth: <TOKEN>"

Where <TOKEN> is the x-auth-token.


curl -v -F filetype=cran_source_package -F content=@abc_2.1.tar.gz -H"X-Auth: 46e98d3dbf2378bb26e2107867652ee734eb098ea5b96f35"

Please use cran_source_package for source packages and cran_binary_package for binary R packages.


You can use your domain as a repository URL in the install.packages function by injecting a token into the path:


This may look something like the following:


> install.packages("abc", repos="")