@@ -12,21 +12,6 @@ prepared `manifest.json` file. See ["Deploying R or Other
1212Content"] ( #deploying-r-or-other-content ) for details.
1313
1414
15- ## Deploying Python Content to Posit Connect
16-
17- Posit Connect supports the deployment of Jupyter notebooks, Python APIs (such as
18- those based on Flask or FastAPI) and apps (such as Dash, Streamlit, and Bokeh apps).
19- Much like deploying R
20- content to Posit Connect, there are some caveats to understand when replicating your
21- environment on the Posit Connect server:
22-
23- Posit Connect insists on matching ` <MAJOR.MINOR> ` versions of Python. For example,
24- a server with only Python 3.9 installed will fail to match content deployed with
25- Python 3.8. Your administrator may also enable exact Python version matching which
26- will be stricter and require matching major, minor, and patch versions. For more
27- information see the [ Posit Connect Admin Guide chapter titled Python Version
28- Matching] ( https://docs.posit.co/connect/admin/python/#python-version-matching ) .
29-
3015### Installation
3116
3217To install ` rsconnect-python ` from PYPI, you may use any python package manager such as
@@ -233,6 +218,33 @@ ensuring that you use the same Python that you use to run your Jupyter Notebook:
233218/path/to/python -m pip list --format=freeze
234219```
235220
221+ #### Python Version
222+
223+ When deploying Python content to Posit Connect,
224+ the server will require matching ` <MAJOR.MINOR> ` versions of Python. For example,
225+ a server with only Python 3.9 installed will fail to match content deployed with
226+ Python 3.8. Your administrator may also enable exact Python version matching which
227+ will be stricter and require matching major, minor, and patch versions. For more
228+ information see the [ Posit Connect Admin Guide chapter titled Python Version
229+ Matching] ( https://docs.posit.co/connect/admin/python/#python-version-matching ) .
230+
231+ We recommend installing a version of Python on your client that is also available
232+ in your Connect installation. If that's not possible, you can override
233+ rsconnect-python's detected Python version and request a version of Python
234+ that is installed in Connect, For example, this command:
235+
236+ ``` bash
237+ rsconnect deploy api --override-python-version 3.11.5 my-api/
238+ ```
239+
240+ will deploy the content in ` my-api ` while requesting that Connect
241+ use Python version 3.11.5.
242+
243+ > ** Note**
244+ > The packages and package versions listed in ` requirements.txt ` must be
245+ > compatible with the Python version you request.
246+
247+
236248#### Static (Snapshot) Deployment
237249
238250By default, ` rsconnect ` deploys the original notebook with all its source code. This
@@ -371,6 +383,32 @@ ensuring that you use the same Python that you use to run your API or applicatio
371383/path/to/python -m pip list --format=freeze
372384```
373385
386+ #### Python Version
387+
388+ When deploying Python content to Posit Connect,
389+ the server will require matching ` <MAJOR.MINOR> ` versions of Python. For example,
390+ a server with only Python 3.9 installed will fail to match content deployed with
391+ Python 3.8. Your administrator may also enable exact Python version matching which
392+ will be stricter and require matching major, minor, and patch versions. For more
393+ information see the [ Posit Connect Admin Guide chapter titled Python Version
394+ Matching] ( https://docs.posit.co/connect/admin/python/#python-version-matching ) .
395+
396+ We recommend installing a version of Python on your client that is also available
397+ in your Connect installation. If that's not possible, you can override
398+ rsconnect-python's detected Python version and request a version of Python
399+ that is installed in Connect, For example, this command:
400+
401+ ``` bash
402+ rsconnect deploy api --override-python-version 3.11.5 my-api/
403+ ```
404+
405+ will deploy the content in ` my-api ` while requesting that Connect
406+ use Python version 3.11.5.
407+
408+ > ** Note**
409+ > The packages and package versions listed in ` requirements.txt ` must be
410+ > compatible with the Python version you request.
411+
374412### Creating a Manifest for Future Deployment
375413
376414You can create a ` manifest.json ` file for an API or application, then use that
0 commit comments