set conda environment in python script code example Example: create a virtual environment python conda conda create -n yourenvname python=x.x anaconda