You can change your default environment for Python and CPLEX in the experiment Overview.
Before you begin
- Required permissions
- To view environments, you can have any role in a deployment space. To edit or create environments, you must have the Editor or Admin role in the space. For more information, see Deployment space collaborator roles and permissions.
About this task
This video provides a visual method to learn the concepts and tasks in this documentation.
After you load the example in your Decision Optimization experiment, you can follow the video.
Video disclaimer: Some minor steps and graphical steps in this video might differ from your platform. The user interface is also frequently improved.
When you use the experiment UI, the necessary environments are created for you automatically. However, you can, configure the environment to be used for your solve, by changing the default environment. This environment will then be applied to all scenarios in your experiment. The environment will depend on your model type: Python, OPL, CPLEX, CPO, or Modeling Assistant.
Python is used to run Decision Optimization models formulated in DOcplex in Decision Optimization experiments. Modeling Assistant models also use Python because DOcplex code is generated when models are run or deployed. Models formulated in OPL or in specific file formats for CPLEX or CP Optimizer, such as LP or CPO formats, do not use Python environments.
The Decision Optimization environment currently supports Python 3.10. The default version is Python 3.10.
The following procedure shows you how to change the default environment for DOcplex and Modeling Assistant models. This can be useful for checking if your model works with the latest version of CPLEX, or for testing your model with larger data sets that require more hardware. Or perhaps you need to update the Python version or want to include some particular Python libraries using Python extensions.
To select a different run environment for a particular scenario, see Selecting a different run environment for a particular scenario.
Procedure
To change the default environment for DOcplex and Modeling Assistant models:
Selecting a different run environment for a particular scenario
You can choose different environments for individual scenarios on the Environment tab of the Run configuration pane.
About this task
This task is useful if you don't want certain scenarios to use the default environment (this is when more than one Python version is supported, currently Python 3.10 is available). See Run environment tab for more details.
To select a different run environment for a particular scenario, without changing the default for all the other scenarios:
Procedure
- Open the Scenario pane and select your scenario in the Build model view.
- Click the Configure run icon next to the Run button to open the Run configuration pane and select the Environment tab.
- Choose Select run environment for this scenario, choose an environment from the drop-down menu, and click Run.
- Open the Overview information pane. You can now see that your scenario has your chosen environment, while other scenarios are not affected by this modification.