Use Pipenv with JFrog CLI
Configure and run jf pipenv with JFrog Artifactory for Pipfile dependency resolution and build-info.
Run pipenv install with Artifactory integration and optional build-info collection.
This topic covers the following tasks:
When to Use
Use jf pipenv if your Python project uses Pipenv (with Pipfile and Pipfile.lock) instead of pip with requirements.txt. For pip-based projects, use jf pip instead. For Poetry-based projects, use jf poetry. For uv-managed projects, use jf uv.
Package Alias (Ghost Frog)
To run native
pipenvcommands without thejfprefix, see Use JFrog CLI Package Alias.
Package manager version compatibility
Before you begin, review Supported Package Manager Versions for the Pipenv versions supported and tested with JFrog CLI.
Prerequisites
- Pipenv must be installed. On macOS, the recommended method is
brew install pipenv. Alternatively, usepip install pipenv. On macOS, this installs thepipenvbinary to~/Library/Python/X.Y/bin, which is not on$PATHby default. Verify withpipenv --versionafter installation. If the command is not found, add the install directory to your$PATHor use Homebrew instead. - Run
jf pipenv-configin the project directory before the first install. - Configure a server with
jf config addorjf c add. - Authentication to Artifactory is required. If you use a reference token (identity token) rather than a standard JWT access token, you must also provide a username when configuring the server. Some package managers, including Pipenv, require basic authentication and do not support reference tokens alone.
Configuration: jf pipenv-config
Generate pipenv build configuration for dependency resolution and deployment. Run this once per project before your first install.
To configure Pipenv for Artifactory:
Synopsis
jf pipenv-config [options]
Aliases: pipec
Configuration Options
| Flag | Default | Description |
|---|---|---|
--global | false | Set to true for global configuration (all projects). Specific projects can override. |
--repo-deploy | — | Repository for artifacts deployment |
--repo-resolve | — | Repository for dependencies resolution |
--server-id-deploy | — | Artifactory server ID for deployment. Configure with jf config add. |
--server-id-resolve | — | Artifactory server ID for resolution. Configure with jf config add. |
Configuration Examples
View Help
jf pipenv-config --helpNon-Interactive Configuration with Flags
jf pipenv-config --server-id-resolve=<server-id> --repo-resolve=<repo-name> --server-id-deploy=<server-id> --repo-deploy=<repo-name>Where:
<server-id>: The server ID configured usingjf config add<repo-name>: The name of the repository in Artifactory
For example:
jf pipenv-config --server-id-resolve=my-server --repo-resolve=pypi-virtual --server-id-deploy=my-server --repo-deploy=pypi-localWhy Run Config First?
You must run jf pipenv-config before jf pipenv install. The config creates .jfrog/projects/pipenv.yaml for Artifactory integration. Without it, jf pipenv does not know where to fetch packages.
If you skip this step, you will see the error: no config file was found! Before running the 'jf pipenv' command on a project for the first time, the project should be configured with the 'jf pipenv-config' command.
Shortcut
In CI/CD, pass all flags non-interactively so the config step is fully automated and reproducible.
Configuration Notes
- Run once per project: Re-run when changing repository assignments.
- Alternative: If your project uses
requirements.txtinstead ofPipfile, usejf pip-configandjf pipinstead.
Expected Output
$ jf pipenv-config --server-id-resolve=my-server --repo-resolve=pypi-virtual --server-id-deploy=my-server --repo-deploy=pypi-local
[Info] pipenv build config successfully created.
How to Verify
After running, confirm the configuration exists:
cat .jfrog/projects/pipenv.yamlThe file should contain:
version: 1
type: pipenv
resolver:
repo: <repo-resolve-value>
serverId: <server-id>
deployer:
repo: <repo-deploy-value>
serverId: <server-id>Build: jf pipenv
Run pipenv install with Artifactory integration and optional build-info collection.
To run Pipenv with Artifactory integration:
Synopsis
jf pipenv <pipenv-arguments> [options]
Aliases: none
Arguments
| Argument | Required | Description |
|---|---|---|
<pipenv-arguments> | Yes | Arguments and options for the pipenv command (for example, install, lock) |
Build Options
| Flag | Default | Description |
|---|---|---|
--build-name | — | Build name for build-info. Requires --build-number. |
--build-number | — | Build number for build-info. Requires --build-name. |
--module | — | Optional module name for build-info. Requires --build-name and --build-number. |
--project | — | JFrog Artifactory project key |
Build Examples
View Help
jf pipenv --helpInstall Dependencies with Build-Info
jf pipenv install --build-name=<build-name> --build-number=<build-number>Where:
<build-name>is a name for the build (for example,my-python-app)<build-number>is a number or identifier for the build run (for example,1)
For example:
jf pipenv install --build-name=my-python-app --build-number=1On success, Pipenv outputs the resolved and installed packages, followed by confirmation that Pipfile.lock was updated. JFrog CLI records the installed packages as build-info dependencies. No additional JFrog-specific output is printed unless there is a warning or error.
Install from Pipfile
jf pipenv installOn success, Pipenv outputs progress for virtual environment creation (if new), dependency resolution, and package installation. For example:
[Info] Running pipenv install
Installing dependencies from Pipfile.lock...
To activate this project's virtualenv, run pipenv shell.
Recording All Dependencies
JFrog CLI records installed packages as build-info dependencies. The recorded dependencies are packages installed during the jf pipenv install command execution. When running inside a Python environment that already has some packages installed, those packages will not be included in the build-info because they were not originally installed by JFrog CLI.
To capture all dependencies in build-info when the environment was pre-populated:
-
Remove the existing virtual environment:
pipenv --rm -
Recreate the environment and install through JFrog CLI:
jf pipenv install --build-name=<build-name> --build-number=<build-number>Where:
<build-name>: Your build name<build-number>: Your build number or identifier
Package details are cached in .jfrog/projects/deps.cache.json for subsequent build-info assembly.
Important Notes
- Pipenv commands: All standard Pipenv arguments work (
install,lock,sync, and others). - Build-info: Use
--build-nameand--build-number, then publish withjf rt build-publish.
CI/CD Example: GitHub Actions
Package Alias (Ghost Frog)
To run
pipenvwithout thejfprefix, enable Package Alias insetup-jfrog-cliand setJFROG_CLI_GHOST_FROG=true. If you install the tool after the action (for examplesetup-javaorsetup-node), re-pin the alias path toGITHUB_PATH. See Use JFrog CLI Package Alias.
# .github/workflows/build.yml
steps:
- uses: actions/checkout@v4
- name: Setup JFrog CLI
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ vars.JF_URL }}
JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Pipenv
run: pip install pipenv
- name: Configure Pipenv
run: jf pipenv-config --server-id-resolve=setup-jfrog-cli-server --repo-resolve=pypi-virtual
- name: Install dependencies
run: jf pipenv install --build-name=my-python-app --build-number=${{ github.run_number }}
- name: Publish build info
run: jf rt build-publish my-python-app ${{ github.run_number }}Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
no config file was found | jf pipenv-config was not run | Run jf pipenv-config in the project directory |
404 on jf pipenv install | Resolution repository does not exist or name is wrong | Verify the repo name matches an existing PyPI virtual repository in Artifactory |
| 401 / 403 errors | Invalid credentials or insufficient permissions | Re-run jf config add with a valid access token |
[Warn] couldn't extract payload from Access Token | A reference (identity) token was used. Pipenv requires basic authentication | Re-run jf config add and supply both a username and a password or scoped access token. Reference tokens are not supported by Pipenv's package resolution layer. |
| Build-info missing some dependencies | Packages were installed before JFrog CLI was used | Delete the virtual environment (pipenv --rm), recreate it, then run jf pipenv install |
Pipfile.lock out of sync | Lockfile was generated outside JFrog CLI | Run jf pipenv lock to regenerate from Artifactory sources |
command not found: pipenv after pip install pipenv | On macOS, pip install places scripts in a non-$PATH directory | Use brew install pipenv instead, or add ~/Library/Python/X.Y/bin to your $PATH |
Enable debug logging: export JFROG_CLI_LOG_LEVEL=DEBUG
Frequently Asked Questions
This section provides answers to frequently asked questions about using Pipenv with JFrog CLI.
FAQs
Q: How do I run pipenv install with build-info using jf pipenv?
A: Run jf pipenv-config once per project to set the resolution and deployment repositories, then run jf pipenv install --build-name=<build-name> --build-number=<build-number> and publish with jf rt build-publish. See Build: jf pipenv.
Q: What happens if the virtual environment already had packages installed?
A: JFrog CLI only records packages installed during a jf pipenv install run, so pre-existing packages are omitted from build-info. Remove the environment with pipenv --rm, recreate it, and reinstall through jf pipenv. See Recording All Dependencies.
Q: What is the difference between jf pipenv and jf pip?
A: Use jf pipenv for projects with a Pipfile and Pipfile.lock. Use jf pip for projects that manage dependencies with requirements.txt instead. See When to Use.
Q: What do I need before running jf pipenv-config?
A: You need Pipenv installed, a JFrog CLI server configured with jf config add, and a username on the server configuration if you authenticate with a reference token. See Prerequisites.
Q: Why do I see a reference token warning when running jf pipenv?
A: Pipenv requires basic authentication, and reference tokens don't carry a username. Re-run jf config add and supply both a username and a password or scoped access token. See Troubleshooting.
Related Topics
Updated 12 days ago
