Python - Generate Requirements
ACCESS THE CUSTOM STEP FOLDER
Description
Generate a requirements.txt file for your Python project or environment directly from SAS Studio. This custom step allows you to either:
- Freeze all packages in a given Python environment, or
- Generate requirements based on the imports used in a folder of Python scripts.
This enables reproducible, portable analytics workflows and helps ensure your Python dependencies are clearly documented for deployment or sharing.
A general idea of how to use steps related to virtual environments:

User Interface
Refer to the "About" tab on this step in SAS Studio for more details.
Parameters
This step helps you generate a requirements file. Input arguments required:
-
What do you want to generate? (radio button group)
- Freeze all packages in a Python environment
- Generate requirements from a folder of Python scripts
-
Python environment folder (folder selector)
- The folder containing
/bin/python3(required if freezing environment)
- The folder containing
-
Project folder (folder selector)
- The folder containing your Python scripts (required if generating from scripts)
-
Requirements file path (file selector)
- The output path for the generated
requirements.txtfile
- The output path for the generated
Requirements
- SAS Viya 4 environment (tested on monthly release 2025.07) with SAS Studio Flows
- Python environment accessible to the SAS Compute Server
- Python package 'pipreqs' to be installed if you wish to generate requirements from Python scripts. Details here.
Installation & Usage
Refer to the steps listed in the main README.md
Version
- 1.1.0 (01SEP2025)
Contact:
- Sundaresh Sankaran (sundaresh.sankaran@sas.com)