How to create a virtual environment and activate it using DataSpell?
Asked
Active
Viewed 2,201 times
1 Answers
1
If you open a directory or a project to the DataSpell workspace, it automatically creates a virtual environment. But, if you want to use a different python version, you can always create another virtual environment.
Steps to create a new virtual environment: I have used conda environment. So, I am showing here how to create a new conda environment.
- Go to File -> Settings -> Project: workspace -> Python Interpreter. Or simply press
Ctrl+Alt+S
from keyboard.
- Press the settings icon from the right corner and click the
Add..
button. Then click on theNew environment
radio button. Select your python version and locations. - Give a name to your environment.
- Click on the
Make available to all projects
checkbox if you want to use this environment for other projects. - Press the
OK
button and then theOK
button again.
You can change the virtual environment for your project as follows,
Like this image, on the bottom right corner of your DataSpell, you see the environment variable. If you click it, you will also see the list of the loaded projects and corresponding environment variables there.
You can change your environment variable for the specific project from here.

Forhad Hossain
- 401
- 4
- 18