question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing to python2.7 interpreter in Spyder3

See original GitHub issue

I have uninstalled Spyder2 and installed Spyder3. I was told that it would be easy to continue using the python2.7 interpreter in the new Spyder3. I changed the interpreter using Preferences > Console > Advanced settings > Use the following Python interpreter: changing this to /usr/bin/python2.7. It comes up with a warning:

You selected a Python 2 interpreter for the console but Spyder is running on Python 3!.

Although this is possible, we recommend you to install and run Spyder directly with your selected   interpreter, to avoid seeing false warnings and errors due to the incompatible syntax between these two Python versions.

I left the default PYTHONSTARTUP option.

Upon choosing to open a new python console I get the following which is correct:

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Upon restarting the IPython console/kernel I get the following message:

An error ocurred while starting the kernel
Traceback (most recent call last):
File "/usr/lib/python3/dist‑packages/spyderlib/widgets/externalshell/start_ipython_kernel.py", line 186, in 
ipk_temp.config = kernel_config()
File "/usr/lib/python3/dist‑packages/spyderlib/widgets/externalshell/start_ipython_kernel.py", line 45, in kernel_config
from spyderlib.config import CONF
ImportError: No module named spyderlib.config

When I switch to the Python console and run my script I get the following message:

runfile('blablabla.../RT_param_compare.py',  wdir=r'blablabla...')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'runfile' is not defined

I am not sure what I should do to remedy this.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

13reactions
jmokoistinencommented, Nov 10, 2016

I found this one useful for anaconda:

Try typing these 3 lines from the anaconda command prompt: conda create -n spyder python=2.7 spyder conda activate spyder spyder

1reaction
jmokoistinencommented, Nov 14, 2017

Yes sorry it should be source activate spyder

After activating Use conda or pip to install other libraries…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change python version in anaconda spyder
keyboard shortcut Ctrl + Alt + Shift + P; Tools -> Preferences. And depending on the Spyder version you can change the interpreter...
Read more >
How to change the Python version in Spider
By “Spider”, I hope you meant Spyder IDE, To change the Python version . Go to Preferences in your IDE or hit CTRL+SHIFT+ALT+P....
Read more >
Changing python interpreter in spyder
So I've changed the interpreter in spyder using Preferences > Console > Advanced settings > Use the following Python interpreter: /opt/local/bin ...
Read more >
How to set python interpreter in spyder with python ... - YouTube
In this video I am going to show how to set python interpreter in spyder with python 3.9.* virtual environment in Windows 10Thank...
Read more >
Switching between Python 2 and Python 3 environments
Create a Python 2 environment named py2, install Python 2.7: · Create a new environment named py3, install Python 3.5: · Activate and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found