Issue
I have python 2.7 as my base. I have created an environment with python 3.7.
conda create -n py3 python=3.7
in Anaconda Prompt. Now I have activated my python 3.7.
conda activate py3 or activate py3
Now I have checked my python version with
python --version
Its states as python 3.7.7
conda run spyder
Now the spyder is launched but it is still opening in python 2.7.
I want to use PyTorch but also need python 2.7 and PyTorch is not suitable to work with python 2.7. I needed to work with PyTorch in python 3.7 and I need python 2.7 also in a single system. How can I do it? Environment setup is ok but the launching of spyder is my real issue.
Solution
Type the following in Anaconda Prompt:
conda create --name py2 Python=2.7
It will create a virtual environment with Python 2.7
activate py2
To run the spyder with the Python version of 2, the command has to be
conda run spyder
To deactivate the virtual environment:
conda deactivate
Same goes for virtual environment with Python 3
conda create --name py3 Python=3.7
activate py3
conda run spyder
conda deactivate
Answered By - Akash Chakraborty
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.