*! version 0.1.0 14aug2026

dbf2stata_setup

Check and, when necessary, install the Python dependency required by
dbf2stata.

Syntax

dbf2stata_setup
[, upgrade]

Description

dbf2stata_setup is the companion setup command for
dbf2stata.

The command identifies the exact Python interpreter currently used by Stata,
checks that Python 3.10 or newer is available, checks for pip, and verifies
whether the public dbf2stata Python package can be imported.

If the package is missing, dbf2stata_setup explicitly installs:

dbf2stata>=0.1.0,<0.2.0

from the Python Package Index (PyPI), using:

sys.executable -m pip install ...

This means the command uses the same Python environment that Stata is already
running. No Windows, macOS, or Linux Python path is hard-coded.

Running dbf2stata does not silently install software. If the dependency
is missing, dbf2stata tells the user to run dbf2stata_setup.
Installation therefore occurs only after the user explicitly invokes the setup
command.

Option

upgrade asks pip to upgrade the installed dbf2stata Python package
within the supported 0.1.x series.

Examples

Normal one-time setup:

. dbf2stata_setup

Check or upgrade the supported Python package:

. dbf2stata_setup, upgrade

Then run:

. dbf2stata

If Python is not configured

dbf2stata_setup itself requires Stata's Python integration. If Python is
not configured, type:

. python query

Configure Python 3.10 or newer for Stata, then rerun
dbf2stata_setup.

Stored results

On successful setup, dbf2stata_setup stores:

r(ready) 1 when the Python dependency is ready

r(python_version) Python version used by Stata

r(python_executable) Python executable used by Stata

r(package_version) installed dbf2stata Python package version

Platform support

The setup mechanism is cross-platform because it uses Stata's active Python
interpreter rather than an operating-system-specific path. It is intended for
Windows, macOS, and Linux.

Author

William Dormechele

University of East Anglia, United Kingdom

Links

Python package:
PyPI

Source code and issue tracker:
GitHub

License

MIT License.

Also see

dbf2stata