spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.21k stars 1.59k forks source link

Wrong python version showed in IPython Console #10984

Open davidhsu-thu opened 4 years ago

davidhsu-thu commented 4 years ago

Description

What steps will reproduce the problem?

After initialing, The IPthon Console shows me "Python 3.7.0 (default, Jun 28 2018, 07:39:16)" I print sys.version which shows me "3.7.5(default, Oct 25 2019, 10:52:18)" In addition, at the bottom of Spyder 4, it shows "conda: base(Python 3.7.5)" It seems that the version showed in the Ipython Console is incorrect.

Versions

Dependencies

cloudpickle >=0.5.0          :  1.2.2 (OK)
pygments >=2.0               :  2.5.2 (OK)
qtconsole >=4.6.0            :  4.6.0 (OK)
nbconvert >=4.0              :  5.6.1 (OK)
sphinx >=0.6.6               :  2.2.2 (OK)
pylint >=0.25                :  2.4.4 (OK)
psutil >=0.3                 :  5.6.7 (OK)
qtawesome >=0.5.7            :  0.6.0 (OK)
qtpy >=1.5.0                 :  1.9.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
zmq >=17                     :  18.1.0 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
numpydoc >=0.6.0             :  0.9.1 (OK)
spyder_kernels >=1.8.1;<2.0.0:  1.8.1 (OK)
qdarkstyle >=2.7             :  2.7 (OK)
atomicwrites >=1.2.0         :  1.3.0 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
intervaltree                 :  None (OK)
watchdog                     :  None (OK)
keyring                      :  None (OK)
pexpect >=4.4.0              :  4.7.0 (OK)
pympler                      :  None (OK)
sympy >=0.7.3                :  1.4 (OK)
cython >=0.21                :  0.29.14 (OK)
IPython >=4.0                :  7.10.1 (OK)
matplotlib >=2.0.0           :  3.1.1 (OK)
pandas >=0.13.1              :  0.25.3 (OK)
numpy >=1.7                  :  1.17.4 (OK)
scipy >=0.17.0               :  1.3.1 (OK)
pyls >=0.31.2;<0.32.0        :  0.31.2 (OK)
applaunchservices >=0.1.7    :  0.2.1 (OK)
rtree >=0.8.3                :  0.8.3 (OK)
ccordoba12 commented 4 years ago

Do you have a different Python interpreter selected in Preferences > Main interpreter?

colinww commented 4 years ago

I have the identical problem, and the Interpreter is selected to be Default (same as Spyder).

davidhsu-thu commented 4 years ago

The setting in my Spyder is the same as @colinww mentioned. I do not have a different Python interpreter selected in Preferences > Main interpreter. The interpreter is selected to be Default (same as Spyder).

ccordoba12 commented 4 years ago

On issue #11260 @jjhelmus said:

For what is is worth, the 3.7.0 version is coming from the python binary in the python.app package.

That's really helpful! I think I know how to fix this.

ccordoba12 commented 4 years ago

@steff456, please take a look at this one. It only happens in macOS.

steff456 commented 4 years ago

I can't reproduce this issue with the latest 4.x

In an environment with python 3.7.0 I get the version that it is image

And in python 3.7.5, image

ccordoba12 commented 4 years ago

@davidhsu-thu, what are your versions of python and python.app?

colinww commented 4 years ago

Hello @steff456, I am still seeing the issue although my python.app got updated when I updated to spyder 4.1.2, so now the banner message is different. It seems in your two envs, perhaps your python.app and python versions are changing in lock step? Somehow my env got out of sync, I don't use pip or conda-forge, just vanilla channels.

I did some digging into the issue, it appeared to me at the time that the banner message is generated during startup sequence from python.app, not the actual python that will be used by the shell. However it seems to be a benign issue, since my shell has always used the correct version of Python (the version I select). Here is what I found: https://github.com/spyder-ide/spyder/issues/11260 The manifestation of the bug at the time made me unable to launch spyder, but the root cause seems to be the same.

This is what I see from launching spyder now (with default interpreter selected). Screen Shot 2020-04-16 at 11 04 46 AM

Again because right now this seems to be a cosmetic bug, it's OK with me... thank you!

davidhsu-thu commented 4 years ago

This is what IPython Console showed on my computer. image

ccordoba12 commented 4 years ago

Unfortunately we've been unable to reproduce this one.