Docker images with various combinations of Python, Mono, and pythonnet versions.
Get a Python shell:
$ docker run -it --rm mosthege/pythonnet:python3.11.1-mono6.12-pythonnet3.0.1 python Python 3.11.1 (main, Dec 8 2022, 00:05:00) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
Inside the Python shell:
>>> import clr >>> from System import Environment >>> print(Environment.MachineName) 79000da3c53a
The method for installing is slightly different for each of the three main components of this image (Python, Mono, pythonnet):
-stretchvariant of the Python Docker images is used because the slimmer variants (
-alpine) do not include the tooling required for the Mono and pythonnet installs later.
The Python versions included are a subset of those available in the Python Dockerhub repository, excluding pre-release versions.
The Python Dockerhub repository generally includes the latest stable version of every supported branch of Python (for example
3.5.4 but not
3.5.3, and none of
Currently, there are no abbreviated version tags (e.g.
3.6 pointing at
3.6.4) since including those would increase the maintenance effort.
The pythonnet installation instructions recommend an install via
pip install pythonnet, or via
conda install -c conda-forge pythonnet.
In the Docker images here, we install via PyPI/pip.