# jf pipenv Run pipenv install with Artifactory integration and optional build-info collection. This topic covers the following tasks: * [Configure Pipenv for Artifactory (`jf pipenv-config`)](#configuration-jf-pipenv-config) * [Run Pipenv commands (`jf pipenv`)](#build-jf-pipenv) ## 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`](jf-pip.md) instead. For Poetry-based projects, use [`jf poetry`](jf-poetry.md). ## Prerequisites * Pipenv must be installed (`pip install pipenv`). * Run `jf pipenv-config` in the project directory before the first install. * Configure a server with `jf config add` or `jf c add`. * Authentication to Artifactory is required. *** ## 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 ```bash jf pipenv-config --help ``` #### Non-Interactive Configuration with Flags ```bash jf pipenv-config --server-id-resolve= --repo-resolve= --server-id-deploy= --repo-deploy= ``` Where: * \: The server ID configured using `jf config add` * \: The name of the repository in Artifactory For example: ```bash jf pipenv-config --server-id-resolve=my-server --repo-resolve=pypi-virtual --server-id-deploy=my-server --repo-deploy=pypi-local ``` ### Why 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.txt` instead of `Pipfile`, use `jf pip-config` and `jf pip` instead. ### Expected Output ``` $ jf pipenv-config --server-id-resolve=my-server --repo-resolve=pypi-virtual --server-id-deploy=my-server --repo-deploy=pypi-local Pipenv build configuration saved successfully. ``` ### How to Verify After running, confirm the configuration exists: ```bash cat .jfrog/projects/pipenv.yaml ``` *** ## Build: `jf pipenv` Run pipenv install with Artifactory integration and optional build-info collection. **To run Pipenv with Artifactory integration:** ### Synopsis ``` jf pipenv [options] ``` **Aliases:** none ### Arguments | Argument | Required | Description | | -------------------- | -------- | ----------------------------------------------------------------------------- | | `` | 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 ```bash jf pipenv --help ``` #### Install Dependencies with Build-Info ```bash jf pipenv install --build-name= --build-number= ``` Where: * `` is a name for the build (e.g., `my-python-app`) * `` is a number or identifier for the build run (e.g., `1`) For example: ```bash jf pipenv install --build-name=my-python-app --build-number=1 ``` #### Install from Pipfile ```bash jf pipenv install ``` *** ## 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. The details of all installed packages are cached in `.jfrog/projects/deps.cache.json`. If the environment had packages installed before the first execution, delete the virtual environment (`pipenv --rm`) and recreate it, then run `jf pipenv install` to capture all packages in the build-info and cache. ## Important Notes * **Pipenv commands**: All standard Pipenv arguments work (`install`, `lock`, `sync`, and others). * **Build-info**: Use `--build-name` and `--build-number`, then publish with `jf rt build-publish`. ## CI/CD Example (GitHub Actions) ```yaml # .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 | | 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 | **Enable debug logging:** `export JFROG_CLI_LOG_LEVEL=DEBUG`
## Related Topics * [Build Tools Overview](/artifactory/docs/build-tool-commands) — Capabilities matrix and tool reference * [Native Mode](/artifactory/docs/native-mode) — Supported packages with Native Mode