{"id":28156,"library":"rsconnect-python","title":"rsconnect-python","description":"The Posit Connect command-line interface (CLI) for deploying Python content (Dash, Streamlit, Flask, Jupyter Notebooks) to RStudio Connect / Posit Connect servers. Current version: 1.29.0. Released on a quarterly cadence.","status":"active","version":"1.29.0","language":"python","source_language":"en","source_url":"https://github.com/posit-dev/rsconnect-python","tags":["posit-connect","deployment","cli","rstudio-connect","dash","streamlit","flask","jupyter"],"install":[{"cmd":"pip install rsconnect-python","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"CLI framework","package":"click","optional":false},{"reason":"HTTP calls to Connect server","package":"requests","optional":false},{"reason":"Python 2/3 compatibility (legacy)","package":"six","optional":false}],"imports":[{"note":"RSConnect class is in the api module, not top-level.","wrong":"from rsconnect import RSConnect","symbol":"RSConnect","correct":"from rsconnect.api import RSConnect"},{"note":"","wrong":"","symbol":"api_resolve_server","correct":"from rsconnect.api import api_resolve_server"}],"quickstart":{"code":"from rsconnect.api import RSConnect\n\n# Replace with your server URL and API key\nserver = RSConnect(\n    server='https://connect.example.com',\n    api_key=os.environ.get('CONNECT_API_KEY', ''),\n)\n\n# Get server info\ninfo = server.server_info()\nprint(info)\n","lang":"python","description":"Initialize RSConnect client with server URL and API key from environment variable."},"warnings":[{"fix":"Ensure your environment uses the correct Python interpreter. If necessary, set the `CONNECT_PYTHON` environment variable instead of relying on the flag.","message":"In version 1.28.0, the `--python` flag behavior changed: it now uses the Python interpreter from the environment, not the one passed to the flag. Use `--python` only to specify a custom Python binary, not to set the environment.","severity":"breaking","affected_versions":">=1.28.0"},{"fix":"Replace `rsconnect write-manifest` with `rsconnect manifest` in your workflows.","message":"The `rsconnect write-manifest` command is deprecated in favor of `rsconnect manifest`.","severity":"deprecated","affected_versions":">=1.20.0"},{"fix":"Set required environment variables in the Posit Connect dashboard after deployment, or use the `rsconnect environment` command to set them programmatically.","message":"If your content uses environment variables, they must be defined on the Posit Connect server under the content's 'Vars' tab. The `rsconnect deploy` command does not read local .env files.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `rsconnect deploy --no-dependencies` to skip dependency resolution, or use `rsconnect write-manifest` and manually upload the bundle.","message":"The `rsconnect deploy` command by default tries to download dependencies (like pip install). If your environment has network restrictions, use `--no-dependencies` or pre-build the environment.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `pip install rsconnect-python` (note: package name is rsconnect-python, but import is rsconnect).","cause":"The package is not installed or is installed under a different name.","error":"ModuleNotFoundError: No module named 'rsconnect'"},{"fix":"Provide full URL with https://, e.g., `https://connect.example.com`.","cause":"Server URL is missing the protocol (http:// or https://) or is malformed.","error":"rsconnect.api.InvalidConfigurationError: The server_url must be a valid URL"},{"fix":"Generate an API key from the Posit Connect dashboard under your profile, and pass it via the constructor or environment variable `CONNECT_API_KEY`.","cause":"API key is missing or incorrect.","error":"rsconnect.api.InvalidConfigurationError: The api_key must be a valid API key"},{"fix":"Use the full path to the Python executable (e.g., `/usr/bin/python3.10`) or rely on the environment's default Python.","cause":"The Python interpreter path passed to `--python` does not exist or is not executable.","error":"click.ClickException: Error: Invalid value for '--python': 'python3.10' is not a valid Python interpreter"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}