ARTIFACTORY: How to resolve the issue of download pypi failures caused by inconsistent directory levels after migrating PyPI packages from Nexus to Artifactory

ARTIFACTORY: How to resolve the issue of download pypi failures caused by inconsistent directory levels after migrating PyPI packages from Nexus to Artifactory

AuthorFullName__c
Jian Sun
articleNumber
000006192
FirstPublishedDate
2024-09-30T11:25:20Z
lastModifiedDate
2025-08-01
VersionNumber
3

Issue Description 

JFrog provides a Nexus migration tool to help users migrate artifacts from Nexus to Artifactory. However, when migrating PyPI artifacts from Nexus to Artifactory, clients may encounter an issue that the download of PyPI artifacts fails.

This issue is caused by the inconsistency between the directory structures of PyPI artifacts stored in Nexus and those stored in Artifactory. When migrating from Nexus to the Artifactory PyPI repository, a layer of directories named 'package' is added by default, which prevents clients from downloading PyPI packages correctly.

  • Nexus PyPI location example:

User-added image
 

  • Artifactory PyPI location example after migration:


User-added image
 

  • It will return the 404 error when the client attempts to download the package from Artifactory.

User-added image


Resolution 

We can copy the artifacts from the package directory to the PyPI repository's root directory using the JFrog CLI cp command. An example is as follows:

# add the Artifactory service in the client:
jf c add <server-id> --url=<JFrog Platform URL> --user=<username> --password=<password> --interactive=false

# use the added Artifactory service:
jf c use <server-id>

# test the Connection:
jf rt ping

# copy the pypi artifactes to the root dir
jf rt cp "test-pypi/packages/(*)" test-pypi/{1}


User-added image


Running the download test in the client:

pip3 install pathlib2


User-added image

We can delete the package directory after the test has been completed successfully.