Environment:Gretelai Gretel synthetics Python Base Environment
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Data_Science |
| Last Updated | 2026-02-14 19:00 GMT |
Overview
Python 3.9+ base environment with core data science libraries (NumPy, Pandas, SDV, RDT, SentencePiece) shared across all gretel-synthetics workflows.
Description
This environment defines the common Python runtime and base dependencies required by all gretel-synthetics workflows. It includes data manipulation libraries (NumPy, Pandas), the SDV/RDT ecosystem for tabular data handling, SentencePiece for tokenization, and utility libraries. This base layer is extended by the TensorFlow or PyTorch environments for specific model types.
Usage
This environment is a prerequisite for all workflows. The TensorFlow GPU Environment and PyTorch CUDA Environment both build on top of this base. Install this as the minimum requirement to use any gretel-synthetics functionality.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux, macOS, Windows | Per setup.py classifiers (POSIX Linux, MacOS, Microsoft Windows) |
| Python | >= 3.9 | Specified in setup.py `python_requires=">=3.9"` |
| Disk | Varies | Depends on training data size; model checkpoints stored locally |
Dependencies
Python Packages (Core)
- `category-encoders` == 2.2.2
- `joblib` == 1.4.2
- `numpy` >= 1.18.0, < 1.24
- `packaging` < 22.0
- `pandas` >= 1.1.0, < 2
- `rdt` >= 1.2, < 1.3
- `sdv` >= 0.17, < 0.18
- `sentencepiece` == 0.2.0
- `smart_open` >= 2.1.0, < 6.0
- `tqdm` < 5.0
Python Packages (Utils Extra)
- `dython` == 0.7.0
- `scikit-learn` >= 0.24
- `scipy` >= 1.4.1, < 1.11
Python Packages (Testing)
- `pytest` == 6.1.2
- `pytest-cov` == 2.11.1
- `faker` == 20.1.0
- `flake8` == 4.0.1
- `pylint` == 2.14.3
Credentials
No API keys or credentials are required. All data is loaded from local files or in-memory DataFrames.
Quick Install
# Base install (core dependencies only)
pip install gretel-synthetics
# With utils extras (statistical evaluation tools)
pip install gretel-synthetics[utils]
# Full install with all model backends
pip install gretel-synthetics[all]
Code Evidence
Python version requirement from `setup.py:52`:
python_requires=">=3.9",
Base requirements loaded from `setup.py:32-37`:
base_reqs = reqs("requirements/base.txt")
utils_reqs = reqs("requirements/utils.txt")
torch_reqs = reqs("requirements/torch.txt")
tf_reqs = reqs("requirements/tensorflow.txt")
Extras defined in `setup.py:54-61`:
extras_require={
"all": [req for reqs in all_reqs for req in reqs],
"utils": utils_reqs,
"test": test_reqs,
"torch": torch_reqs,
"tensorflow": tf_reqs,
"docs": doc_reqs,
},
Version-pinned base dependencies from `requirements/base.txt`:
category-encoders==2.2.2
joblib==1.4.2
numpy>=1.18.0,<1.24
packaging<22.0
pandas>=1.1.0,<2
rdt>=1.2,<1.3
sdv>=0.17,<0.18
sentencepiece==0.2.0
smart_open>=2.1.0,<6.0
tqdm<5.0
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `ImportError: No module named 'sentencepiece'` | SentencePiece not installed | `pip install sentencepiece==0.2.0` |
| NumPy compatibility errors | NumPy >= 1.24 breaking changes | Pin NumPy: `pip install numpy>=1.18.0,<1.24` |
| Pandas API deprecation warnings | Pandas >= 2.0 breaking changes | Pin Pandas: `pip install pandas>=1.1.0,<2` |
| `ImportError: No module named 'sdv'` | SDV ecosystem not installed | `pip install sdv>=0.17,<0.18 rdt>=1.2,<1.3` |
Compatibility Notes
- NumPy: Strictly pinned to < 1.24 due to API changes in newer versions.
- Pandas: Strictly pinned to < 2.0 due to breaking API changes.
- SDV/RDT: Pinned to specific minor version ranges (SDV 0.17.x, RDT 1.2.x) due to tight coupling with internal APIs. The codebase includes monkey-patches for RDT FloatFormatter rounding bugs.
- SentencePiece: Pinned to exact version 0.2.0 for consistent tokenizer behavior.
- scipy: Utils extra requires scipy < 1.11 for statistical evaluation tools.
Related Pages
- Implementation:Gretelai_Gretel_synthetics_TensorFlowConfig
- Implementation:Gretelai_Gretel_synthetics_Tokenizer_Training_Pipeline
- Implementation:Gretelai_Gretel_synthetics_DataFrameBatch_Init
- Implementation:Gretelai_Gretel_synthetics_ACTGAN_Init
- Implementation:Gretelai_Gretel_synthetics_ACTGAN_Fit
- Implementation:Gretelai_Gretel_synthetics_DGANConfig
- Implementation:Gretelai_Gretel_synthetics_DGAN_Train_Numpy