Uploading and installing Standard Python packages#
To work with Standard Python packages, you must use the corresponding subdomain
https://pypi.anaconda.org. To install Standard Python packages from the user
travis, for example, use the repository URL
Uploading Standard Python packages#
We can test Standard Python package uploading with a small public example package saved in the anaconda-client repository.
Use the terminal (Anaconda Prompt for Windows users) to perform the following steps:
Begin by cloning the repository from the command line:
# Replace <PACKAGE_NAME> with the package name git clone firstname.lastname@example.org:Anaconda-Platform/anaconda-client.git cd anaconda-client/<PACKAGE_NAME>/pypi/
You can now create your Standard Python package with the
python setup.py sdist
The package has now been built as a source tarball and is ready to be uploaded:
anaconda upload dist/*.tar.gz
Your package is now available at
<USERNAME>is your username and
<PACKAGE_NAME>is the package name.
Installing Standard Python packages#
The best way to install a Standard Python package is using
pip. For the following command, we use the package we authored in the examples above. Open a terminal (Anaconda Prompt for Windows users) and run the following command:
# Replace <USERNAME> with your username pip install --extra-index-url https://pypi.anaconda.org/<USERNAME>/simple pypi-test-package
Installing private Standard Python packages#
The best way to manage access or make Standard Python packages and other packages private is to create organizations or groups, which allow you to set separate permissions per package, notebook, or environment.
You can also control access with the token system. All Anaconda.org URLs can be appended with
/t/$TOKEN to access private packages.
Open a terminal (Anaconda Prompt for Windows users) and run the following command:
# Replace <TOKEN_NAME> with the name of the token you created # Replace <USERNAME> with your username # Replace <SIMPLE_TEST_PACKAGE> with the actual test-package name TOKEN=$(anaconda auth --create --name <TOKEN_NAME>) pip install --index-url https://pypi.anaconda.org/t/$TOKEN/<USERNAME>/<SIMPLE_TEST_PACKAGE>
Working with standard python wheel files#
When Anaconda Client uploads a wheel file, it uses the Standard Python compliant package name format. This replaces any underscores (_) and periods (.) with dashes (-). If you need to add a wheel file to an already-existing conda package and that package name contains underscores or periods, specify the package name with the
# Replace <PACKAGE_NAME> with the package name # Replace </PATH/TO/WHEEL_FILE> with the wheel file and the file path anaconda upload --package <PACKAGE_NAME> </PATH/TO/WHEEL_FILE>
Finding help for uploading packages#
You can obtain a complete list of upload options, including:
Availability to other users.
To list the options, run the following in a terminal (Anaconda Prompt for Windows users):
anaconda upload -h