help for opendf installpython (opendf_installpython) version 2.0.2 (28 August 2024)

opendf installpython -- Downloads a Portable Python Installation.

Syntax

opendf installpython
[, version() location()]

options

version(string) specifies a Python version. eg. "3.12"

location(string) specifies a path where to copy Python to

Description

opendf installpython Copies a portable Python installation to your computer. For Python version to work with the opendf package in Stata install Python to default location (Stata ado plus folder).

The command only works for Windows and does not require administrator privileges. But the user needs writing permission for the folder where Python is saved.

version Specifies the version of Python. It should be 2.7 or higher to function with Stata. Default is 3.12. Python 3 is strongly recommended.

location Specifies the location where the Python folder will be copied to. If this option is set, the user has to manually indicate where Python is located using set python_exec "path to python.exe" at every start of Stata.

Remarks

This command from the opendf package is part of the Open Data Format Project bundle, written to assist with survey data files in the open data format(.zip).

The deployed Python version will not be found automatically by Stata. However, it will be found by the functions of the opendf package, if it is installed to the default location (ado/plus-folder of Stata).

To activate any Python installation on your computer in Stata, run: set python_exec "C:/...path to python.exe".

Examples

Install portable Python v3.12 (default) to the folder python3.12 in the ado\plus folder.

. opendf installpython

Install Python v3.10 to the folder python3.10 in the ado\plus folder.

. opendf installpython, version("3.10")

Install Python v3.10 to the folder "C:\Program Files\python".

. opendf installpython, version("3.10") location("C:\Program Files\python")

Author

Tom Hartl (thartl@diw.de), Deutsches Institut für Wirtschaftsforschung Berlin.

Also see

Help: opendf read, opendf write, opendf docu, opendf installpython, opendf removepython