Configuring pip and installing Python packages
To use pip
with CodeCatalyst, you must connect pip
to your package repository and provide a personal access token for authentication. You can view
instructions for connecting pip
to your package repository in the CodeCatalyst console. After you authenticate and connect pip
to CodeCatalyst, you can run
pip
commands.
Contents
Installing Python packages from CodeCatalyst with pip
The following instructions explain how to configure pip
to install Python packages
from your CodeCatalyst package repository or one of its upstream repositories.
To configure and use pip
to install Python packages from your CodeCatalyst package repository
-
Open the CodeCatalyst console at https://codecatalyst.aws/
. -
On the overview page for your project, choose Packages.
-
Choose your package repository from the list of package repositories.
-
Choose Connect to repository.
-
In the Connect to repository dialog box, choose pip from the list of package manager clients.
-
You will need a personal access token (PAT) to authenticate pip with CodeCatalyst. If you already have one, you can use that. If not, you can create one here.
-
Choose Create token.
-
Choose Copy to copy your PAT.
Warning
You will not be able to see or copy your PAT again after you close the dialog box.
-
-
Use the
pip config
command to set the CodeCatalyst registry URL and credentials. Replace the following values.Note
If copying from the console instructions, the following values should be updated for you and should not be changed.
Replace
username
with your CodeCatalyst user name.Replace
PAT
with your CodeCatalyst PAT.Replace
space_name
with your CodeCatalyst space name.Replace
proj_name
with your CodeCatalyst project name.Replace
repo_name
with your CodeCatalyst package repository name.
pip config set global.index-url https://
username
:PAT
@https://packages.region
.codecatalyst.aws/pypi/space_name
/proj_name
/repo_name
/simple/ -
Assuming that a package is present in your repository or one of its upstream repositories, you can install it with
pip install
. For example, use the following command to install therequests
package.pip install requests
Use the
-i
option to revert temporarily to installing packages from https://pypi.orginstead of your CodeCatalyst package repository. pip install -i https://pypi.org/simple requests
Consuming Python packages from PyPI through CodeCatalyst
You can consume Python packages from the Python Package Index (PyPI)
To consume packages from PyPI
-
If you haven't already, configure pip with your CodeCatalyst package repository by following the steps in Installing Python packages from CodeCatalyst with pip.
-
Ensure that your repository has added PyPI as an upstream source. You can check which upstream sources are added or add PyPI as an upstream source by following the instructions in Adding an upstream repository and choosing the PyPI store repository.
For more information about requesting packages from upstream repositories, see Requesting a package version with upstream repositories.
pip command support
The following sections summarize the pip commands that are supported, by CodeCatalyst repositories, in addition to specific commands that are not supported.
Supported commands that interact with a repository
This section lists pip
commands where the pip
client makes one
or more requests to the registry it's been configured with. These commands have been verified
to function correctly when invoked against a CodeCatalyst package repository.
CodeCatalyst does not implement pip search
. If you have configured pip
with a
CodeCatalyst package repository, running pip search
will search and show packages from
PyPI
Supported client-side commands
These commands don't require any direct interaction with a repository, so CodeCatalyst does not need to do anything to support them.
Command | Description |
---|---|
Uninstall packages. |
|
Output installed packages in requirements format. |
|
List installed packages. |
|
Show information about installed packages. |
|
Verify that installed packages have compatible dependencies. |
|
Manage local and global configuration. |
|
Build wheels from your requirements. |
|
Compute hashes of package archives. |
|
Helps with command completion. |
|
Show information useful for debugging. |
|
help |
Show help for commands. |