Index URL
When accessing a PyPI repository through Artifactory, the repository URL should be prefixed with api/pypi
in the path. This applies to all pip
commands and distutils
URLs including pip install.
When using pip
to resolve PyPI packages it must point to <Artifactory URL>/api/pypi/<repository key>/simple
.
For example, if you are using Artifactory standalone or as a local service, you would access your PyPI repositories using the following URL:
http://localhost:8081/artifactory/api/pypi/<repository key>/simple
Or, if you are using Artifactory Cloud, the URL would be:
https://<server name>.jfrog.io/artifactory/api/pypi/<repository key>/simple
Once pip is installed, it can be used to specify the URL of the repository from which to resolve:
Installing with full repository URL
$ pip install frog-bar -i http://localhost:8081/artifactory/api/pypi/pypi-local/simple
Note
The default configuration snippet for Nginx and Apache using reverse proxy contains the X-JFrog-Override-Base-Url
by default. If reverse proxy is not used in your environment, you need to add the header manually to the request, for example:
-H "X-JFrog-Override-Base-Url: http://$ART_HOST"
Instead of adding the header manually, you can also run the request on port 8081, or add a slash (/) at the end of the request:
http://$ART_HOST/artifactory/api/pypi/pypi-virtual/simple/