0

I created a virtual environment in Conda for 2.7 named PY27 using the method of this thread:

How to run Spyder in virtual environment?

I have currently Python 3.7 installed and I wanted to emulate 2.7. However, although the environment looks as if it's working in the Anaconda Prompt switching correctly to the new PY27, in Spyder I still see 3.7. In addition, I keep receiving this message: "Note: you may need to restart the kernel to use updated packages."

I have tried to use the conda init powershell command but I still receive the same message.

Thank you very much in advance for your help!

Adam
  • 1

1 Answers1

0

The python version in spyder's title bar is the python version of the environment in which spyder is installed. As of spyder 3.3, you can change the python kernel used by spyder without changing the python version of its environment.

First make sure you have spyder-kernels in your PY27 environment.

conda install -c conda-forge spyder-kernels

I'll recommend you install one of the spyder-kernels = 0* versions

Then execute python -c "import sys; print(sys.executable)" in your PY27 env prompt and copy the output. Open spyder and navigate to Tools -> Preferences -> Python interpreter and paste the command output there. You just told spyder to use yourPY27 env's python interpreter.

Reload spyder and you should see you're PY27 env's python kernel show up on the console.

droptop
  • 1,372
  • 13
  • 24
  • Thank you for your reply! Technically I had already the kernel installed as I checked through Conda Prompt. However, the issues seems to have been fixed by wiping everything away, reinstalling it and re-setting the Python path.... I guess there must have been something wrong in the first installation. Thank you so much again for your advice and I'll keep it in ming for the future! – Adam May 04 '20 at 09:00
  • @Adam That's great!! – droptop May 04 '20 at 11:31