{"id":24367,"library":"pyodide-cli","title":"Pyodide CLI","description":"Command-line interface for building and managing Pyodide packages and distributions. Current version 0.5.0, requires Python >=3.12. Part of the Pyodide project (WebAssembly Python runtime). Release cadence is sporadic, tied to Pyodide releases.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/pyodide/pyodide","tags":["pyodide","cli","webassembly","python","build-tool"],"install":[{"cmd":"pip install pyodide-cli","lang":"bash","label":"Standard pip install"}],"dependencies":[{"reason":"Provides core Pyodide Python APIs and utilities","package":"pyodide-py","optional":true}],"imports":[{"note":"Direct import of pyodide_cli without function call does not execute CLI. Use main() entry point.","wrong":"import pyodide_cli","symbol":"main","correct":"from pyodide_cli import main"}],"quickstart":{"code":"import os\nimport sys\nfrom pyodide_cli import main\n\n# Build a minimal Pyodide environment\n# Example: build a virtual env with pyodide packages\n# This requires additional dependencies (pyodide-build, etc.)\n# Typically invoked via CLI command 'pyodide build'\n\nif __name__ == '__main__':\n    # Simulate CLI args: build a package\n    sys.argv = ['pyodide', 'build', '--help']\n    main()\n","lang":"python","description":"Example of programmatically invoking the CLI. Direct usage is via 'pyodide' command in terminal."},"warnings":[{"fix":"Upgrade Python to >=3.12, or use an older version of pyodide-cli if available (e.g., 0.4.x for Python 3.11).","message":"Pyodide CLI 0.5.0 requires Python 3.12 or higher. Attempting to install on older versions will fail.","severity":"breaking","affected_versions":"0.5.0"},{"fix":"Replace 'pyodide dir' with 'pyodide config show' or 'pyodide config set'.","message":"The CLI command 'pyodide dir' has been deprecated in favor of 'pyodide config' as of pyodide-cli 0.5.0.","severity":"deprecated","affected_versions":"0.5.0"},{"fix":"Run 'pyodide init' to create a default configuration, or set PWDIR environment variable to a valid Pyodide checkout.","message":"Running 'pyodide build' without a valid Pyodide repository or environment configuration will fail with 'ConfigError'. Ensure you have a working Pyodide setup.","severity":"gotcha","affected_versions":">=0.4.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install pyodide-cli' in the correct Python environment.","cause":"Package not installed or installed in a different Python environment.","error":"ModuleNotFoundError: No module named 'pyodide_cli'"},{"fix":"Install with 'pip install pyodide-cli' and ensure Python's bin directory is on PATH. Alternatively, run via 'python -m pyodide_cli'.","cause":"The CLI script is not on PATH. On some installations, the console script may not be registered.","error":"pyodide: command not found"},{"fix":"Run 'pyodide init' in your project directory or set the PWDIR environment variable to point to a Pyodide checkout.","cause":"The CLI needs a configuration or Pyodide source directory to operate.","error":"ConfigError: No pyodide configuration found. Please run 'pyodide init' or set PWDIR environment variable."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}