How to run Spyder with Python 3.7 with Anaconda

2024/10/14 19:24:18

I have installed Anaconda on a Windows 10 machine which comes with Spyder and Python 3.6 but I wish to upgrade to Python 3.7

To create an Anaconda Environment with Python 3.7 is easy by using:

conda create --name py37 python=3.7

or:

conda create --name py370 python=3.7.0 --channel conda-forge

However starting Spyder in this environment will throw it back to Python 3.6. I tried specifing the python.exe (for version 3.7) directly in Tools -> Settings of Spyder, however upon restarting the Spyder Kernels can't be launched and will display that they need the packages: ipykernel and cloudpickle .

When trying to conda install them in the environment the following appears:

The following packages will be DOWNGRADED:python:           3.7.0-hea74fb7_0      --> 3.6.6-hea74fb7_0

Which would downgreade python from 3.7 to 3.6 again.

My final try was to use the command:

conda install python==3.7

which has failed with the output

Solving environment: failedUnsatisfiableError: The following specifications were found to be in conflict:- python-dateutil -> python[version='>=2.7,<2.8.0a0']- python-dateutil -> six- python==3.7
Use "conda info <package>" to see the dependencies for each package.

The question is not how to upgrade Conda to Python 3.7, but how can I get Spyder to work with Python 3.7 in its own environment

Answer

When you run spyder from the CMD/terminal, your operating system tries to find the spyder executable on your system's PATH. In this case, it will default back to the base environment's version of spyder, which runs Python 3.6.

The best way I have found so far is to install spyder to the new environment; activate the environment, and then run spyder (which should fire up the version in the local environment).

conda create --name py37 python=3.7  
conda install --name py37 spyder -c conda-forge
conda activate py37
spyder

However, this requires the version of spyder to support python 3.7. Currently that is not available (as of 2 July 2018), but it should not be too long coming.

EDIT: Spyder for Python 3.7 is available.

https://en.xdnf.cn/q/69377.html

Related Q&A

Pass in a list of possible routes to Flask?

Im learning Flask and have a question about dynamic routing: is it possible to pass in a list of accepted routes? I noticed the any converter which has potential but had a hard time finding examples o…

Tornado @run_on_executor is blocking

I would like to ask how tornado.concurrent.run_on_executor (later just run_on_executor) works, because I probably do not understand how to run synchronous task to not block the main IOLoop.All the exa…

Using Pandas read_csv() on an open file twice

As I was experimenting with pandas, I noticed some odd behavior of pandas.read_csv and was wondering if someone with more experience could explain what might be causing it.To start, here is my basic cl…

Disable Jedi linting for Python in Visual Studio Code

I have set my linter for Python to Pylint, but I still get error messages from Jedi. I even went to settings.json and added the line "python.linting.jediEnabled": false, but the line, though …

Bar plot with timedelta as bar width

I have a pandas dataframe with a column containing timestamps (start) and another column containing timedeltas (duration) to indicate duration.Im trying to plot a bar chart showing these durations with…

Take screenshot of second monitor with python on OSX

I am trying to make an ambient light system with Python. I have gotten pyscreenshot to save a screenshot correctly, but I cant figure out how to get it to screenshot my second monitor (if this is even …

Invoking the __call__ method of a superclass

http://code.google.com/p/python-hidden-markov/source/browse/trunk/Markov.pyContains a class HMM, which inherits from BayesianModel, which is a new-style class. Each has a __call__ method. HMMs __call__…

Efficent way to split a large text file in python [duplicate]

This question already has answers here:Sorting text file by using Python(3 answers)Closed 10 years ago.this is a previous question where to improve the time performance of a function in python i need t…

Creating a unique id in a python dataclass

I need a unique (unsigned int) id for my python data class. This is very similar to this so post, but without explicit ctors. import attr from attrs import field from itertools import count @attr.s(aut…

How to get all the models (one for each set of parameters) using GridSearchCV?

From my understanding: best_estimator_ provides the estimator with highest score; best_score_ provides the score of the selected estimator; cv_results_ may be exploited to get the scores of all estimat…