{"id":8936,"library":"devpi-server","title":"devpi-server","description":"devpi-server is the backend component of the devpi system, providing a robust and flexible solution for hosting private Python package indexes and acting as an on-demand caching mirror for PyPI. It allows users to manage multiple indexes, upload packages and documentation, and configure index inheritance, making it ideal for enterprise environments and local development workflows. The current version is 6.19.3, with a regular release cadence as seen from recent changelog entries.","status":"active","version":"6.19.3","language":"en","source_language":"en","source_url":"https://github.com/devpi/devpi","tags":["package index","pypi","server","devops","caching","python-packages"],"install":[{"cmd":"pip install devpi-server","lang":"bash","label":"Install only the server component"},{"cmd":"pip install devpi","lang":"bash","label":"Install devpi-server, devpi-web (UI) and devpi-client (CLI)"}],"dependencies":[{"reason":"Provides a web-based user interface and search functionality for the devpi-server. Optional but highly recommended for interactive use.","package":"devpi-web","optional":true},{"reason":"Provides command-line tools for interacting with devpi-server, including user and index management, package uploading, and testing. Optional but essential for CLI workflows.","package":"devpi-client"}],"imports":[{"note":"Used for programmatic control and testing of devpi-server instances, allowing creation of server processes and indexes within Python.","symbol":"IndexServer","correct":"from devpi_process import IndexServer"},{"note":"Represents an index on a devpi-server instance for programmatic interaction.","symbol":"Index","correct":"from devpi_process import Index"}],"quickstart":{"code":"import os\nimport shutil\nfrom pathlib import Path\nfrom devpi_process import Index, IndexServer\n\n# Define a temporary directory for the server data\nserver_dir = Path(\"./devpi_temp_server_data\")\n\n# Ensure the directory is clean for a fresh start\nif server_dir.exists():\n    shutil.rmtree(server_dir)\nserver_dir.mkdir()\n\nprint(f\"Starting devpi-server with data directory: {server_dir}\")\nwith IndexServer(server_dir) as server:\n    # The server starts with a 'root' user and a 'root/pypi' index by default.\n    # 'root/pypi' proxies to the public PyPI.\n    print(f\"devpi-server running at: {server.url}\")\n\n    # Programmatically create a new user and an index\n    print(\"Creating user 'myuser' and index 'dev'...\")\n    user_name = \"myuser\"\n    index_name = \"dev\"\n    # Note: devpi_process handles user/index creation via its API, typically abstracting client commands.\n    # In a real scenario, you might interact via devpi-client or its programmatic equivalent\n    # For simplicity, we'll demonstrate a basic server startup and assume external client interaction.\n\n    # Example of how you might interact with the server after it's up\n    # (This part would typically use devpi-client commands externally or a more complete devpi_process API)\n    print(\"You can now interact with the server using devpi-client or pip:\")\n    print(f\"  - Web interface: {server.url}\")\n    print(f\"  - Pip index URL: {server.url}/root/pypi/+simple/\")\n    print(\"Run 'devpi quickstart' in another terminal for client setup examples.\")\n\n    # To keep the server running for a brief moment for demonstration\n    # In a real application, the 'with' block would manage its lifecycle.\n    print(\"Server will run for 10 seconds. Press Ctrl+C to stop sooner.\")\n    import time\n    try:\n        time.sleep(10)\n    except KeyboardInterrupt:\n        print(\"Stopping server.\")\n\nprint(\"devpi-server stopped.\")\nif server_dir.exists():\n    shutil.rmtree(server_dir)\n    print(f\"Cleaned up data directory: {server_dir}\")\n","lang":"python","description":"This quickstart demonstrates how to programmatically start and stop a `devpi-server` instance using the `devpi-process` library. It sets up a temporary server directory and prints the server's URL. For full user and index management, typically the `devpi-client` command-line tool is used, or a more advanced programmatic interaction with the server's REST API."},"warnings":[{"fix":"Use the dedicated `devpi-` commands for initialization, configuration generation, data management, and password setting. For server lifecycle management, integrate `devpi-server` with a process manager like systemd or Supervisor, running `devpi-server` in the foreground.","message":"Several command-line options like `--init`, `--gendeploy`, `--export`, `--import`, `--passwd`, `--start`, `--stop`, `--status`, and `--log` for `devpi-server` were deprecated in versions 5.x and later. These functionalities have been replaced by dedicated `devpi-` commands (e.g., `devpi-init`, `devpi-gen-config`, `devpi-export`, `devpi-passwd`, and using process managers like systemd for server control).","severity":"deprecated","affected_versions":"5.0.0+"},{"fix":"Before upgrading to `devpi-server 4.0.0` from 3.x, export your existing data using the older version (`devpi-export`) and then import it into the new `4.0.0` installation (`devpi-import`).","message":"When upgrading `devpi-server` from versions 3.x to 4.0.0, a change in project name normalization required an export/import cycle of your server data. Failure to do so could result in inconsistent project metadata.","severity":"breaking","affected_versions":"4.0.0"},{"fix":"Start `devpi-server` with `--host 0.0.0.0` to bind to all available network interfaces. Alternatively, configure a reverse proxy like Nginx to expose `devpi-server` on a specific IP or domain.","message":"By default, `devpi-server` may bind only to the loopback address (`127.0.0.1` or `localhost`), making it inaccessible from other machines on the network. Attempts to `pip install` or `devpi use` from a remote host will result in 'Connection refused' errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always use a consistent `--serverdir` path. If managing the server manually, avoid running `devpi-init` on an already initialized directory unless a full reset is intended. For upgrades, refer to specific export/import procedures if data layout changes are involved.","message":"Incorrect management of the `--serverdir` option or server process lifecycle can lead to perceived data loss or inconsistent server states, especially if the `serverdir` path changes between server starts, or if a new `--init` is run on an existing data directory.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Verify the package name and version are correct and have been uploaded to the `devpi-server`. Ensure `pip` is configured with the correct index URL (e.g., `pip install --index-url http://your-devpi-host:3141/youruser/dev/+simple/ <package_name>`). For caching mirrors, ensure the mirror base is correctly configured to include PyPI.","cause":"This typically occurs when `pip` cannot locate the package on the configured `devpi-server` index. Common causes include the package not being uploaded, an incorrect index URL configured in `pip`, or the `devpi-server` not correctly serving the package.","error":"ERROR: Could not find a version that satisfies the requirement <package_name> (from versions: none) / ERROR: No matching distribution found for <package_name>"},{"fix":"Check if `devpi-server` is running. If starting manually, use `devpi-server --host 0.0.0.0` to make it accessible remotely. Verify that no firewall rules are blocking the server's port (default 3141). If using a reverse proxy, ensure it's correctly configured and routing requests to the `devpi-server`.","cause":"The `devpi-server` process is either not running, or it is running but inaccessible due to incorrect binding (e.g., only to `localhost`) or a firewall blocking the port (default 3141).","error":"Connection refused (or [Errno 111] Connection refused) when using devpi client or pip"},{"fix":"While the IDE's UI might fail, typically installation via the terminal using `pip install --index-url=http://your-devpi-host:3141/youruser/dev/+simple/ <package_name>` works. Configure the IDE to use the exact `pip` command or ensure its repository settings precisely match the `devpi-server`'s simple index URL and any required authentication.","cause":"Some IDEs, including PyCharm, may have issues parsing custom PyPI index formats or handling authentication correctly when interacting with `devpi-server`'s web interface, even if the packages are visible.","error":"Packages uploaded to devpi-server appear, but versions are not shown in PyCharm/IDE and installation fails via UI."}]}