9

I just ran into an issue. I had an installation of Anaconda from 2016, it was version 4.1. I then downloaded a new version of Anaconda version 5.1. I installed this version on windows 7. I have now 3 versions of Anaconda on my windows machine, one is for Anaconda with python-2 (v4.1 anaconda), and Anaconda v4.1 with python-3. And the new Anaconda v5.1 with Python-3.

In the older versions when using Spyder IDE, when the console came up, it would state the python version and the version of Anaconda. Now, in the new version it no longer states the Anconda version,

IT now only shows this: 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)]

So the first numbers represents the version of python, the rest says Anaconda but not the version.

Is there a way to find out in Spyder IDE which version of Anaconda it is accessing.

Hope someone can help.

Palu
  • 668
  • 3
  • 11
  • 26
  • (*Spyder maintainer here*) This is something that was probably changed in Anaconda itself and cannot be reverted by Spyder, sorry. – Carlos Cordoba May 22 '18 at 08:22
  • Ok, thanks for your input Carlos, really appreciate someone from Spyder IDE developers to comment on this. Ok, so its the Anaconda people that caused this, I was thinking this was the case. – Palu May 22 '18 at 15:14

2 Answers2

17

Try this in your command line:

conda list Spyder$
Gigi
  • 587
  • 5
  • 12
  • Hi Ghazal, i have not seen this before. Looks interesting. So does this give a list of all the things relating to Spyder, even which python interpreter its using. – Palu Sep 22 '19 at 05:05
  • Hi i ran the command and got this output: #packages in environment at C:\path\to\Anaconda3: spyder 2.3.9 py35_0. – Palu Sep 22 '19 at 05:18
  • I am guessing that py35_0, stands for python 3.5.0. But when i go to windows control panel to see the installed software, i see i have in Anaconda3 installation, i have python version 3.5.2 and i have python also Python 3.4.3 installed from the'Python Software Foundation'. So this command, i wonder if it is just accurate till 3.5.x, and ignores the x portion. – Palu Sep 22 '19 at 05:23
  • @Palu Actually py35_0 would be the build which is slightly different from version. You may wanna look at this link for more info: https://stackoverflow.com/questions/38411942/anaconda-conda-install-a-specific-package-version – Gigi Sep 23 '19 at 17:56
2

Instead of 'versions of Anaconda' you should think in terms of conda environments. Anaconda is just a collection of conda packages including conda itself, Python, Spyder, the Anaconda Navigator and so on, so any given 'version of Anaconda' just means a set of specific versions of those packages.

So if you think you have more than one 'version of Anaconda' installed, the question is which packages you actually have different versions of and where they are. Do you have different conda environments with different versions of Python and other packages (which is how it's supposed to work) or do you somehow have two or three different installations with root environments in different places (probably not a good idea)?

To find out from a Python prompt where your Python interpreter is - including from the console in Spyder - you can type

import sys
sys.executable

When you think you're using Spyder 'in' a particular 'Anaconda version', how are you starting Spyder - by typing a command, from the Anaconda Navigator, or via a Start menu shortcut? If it's one of the first two then you should just activate the environment you want to use before starting Spyder. If you're using a shortcut then it needs to be specific to the environment - creating a new env in Windows Anaconda may or may not create these shortcuts (if this is the problem, see the docs or ask a new question).

If you've activated an environment that contains Python and Spyder before running Spyder, then sys.executable should point to the Python interpreter in that environment and you should have access to the specific versions of the modules that you have installed in that environment.

If your installation is indeed messed up with more than one root environment then you might do best to export the list of packages in each of your environments to a file with conda env export, clean up your installation so you have only one, then recreate the environments from the environment files you exported.

nekomatic
  • 5,988
  • 1
  • 20
  • 27
  • 1
    Hi nekomatic, thanks for your input. Since I have multiple installations on my machine, it was nice to know which python was coming from which Anaconda installation, and Spyder when it started up would show which Python and from which Anaconda installation version. SO that would keep things OK, because you know where everything was coming from. But it seems that the team at Anaconda in its new release has stopped indicating the Anaconda version. – Palu May 22 '18 at 15:17
  • I have certain python scripts in python version2. – Palu May 22 '18 at 15:18
  • I have different version of spyder from the different installations, so that is why it can be confusing, and it would be good to know exactly from the Spyder IDE where its pointing to in terms of python and Anaconda version. – Palu May 22 '18 at 15:19
  • Typing the Python statements in my answer into Spyder's Python console will show you which Python interpreter is currently being used by Spyder. I expect the Anaconda team stopped indicating the "Anaconda version" in the Python startup output because as I've described, it doesn't really mean anything. – nekomatic May 22 '18 at 15:49
  • Well it helps to me, because for example Anacoda2 version 4.1 has python v2.7, Anaconda3 v4.1 has Python v3.4 , and Anaconda3 v5.1 has Python v3.6. So showing the path to the Python within Anaconda and the Anaconda installation version just helps out for you to have a good feeling that you are using the proper version of what you are looking for when you have multiple installations. – Palu May 22 '18 at 16:33
  • When you start Spyder you should have an iPython or a python window. Written in that window is the version of python and ipython it is using, – Natsfan May 23 '18 at 02:38
  • Please see my edit. You need to figure out which *conda environment* you are using at any given time, not which version of Anaconda you happened to use when you installed it. How do you start Spyder? Please edit that into the question if you still need help. – nekomatic May 23 '18 at 08:10