spyder icon indicating copy to clipboard operation
spyder copied to clipboard

Python interpreter not working for Python 3.6.0 environment

Open eghbalhosseini opened this issue 5 years ago • 15 comments

Issue Report Checklist

  • [x ] Searched the issues page for similar reports
  • [ x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [ x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [ x] Could not reproduce inside jupyter qtconsole (if console-related)
  • [ x] Tried basic troubleshooting (if a bug/error)
    • [x ] Restarted Spyder
    • [ x] Reset preferences with spyder --reset
    • [ ]x Reinstalled the latest version of Anaconda
    • [ x] Tried the other applicable steps from the Troubleshooting Guide
  • [ ] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

I am trying to create 2 python interpreter for spyder, one using python 3.8 and another using 3.6. Spyder is installed using Conda in 'base' environment and the python there is 3.7.7 first environment is using python 3.8.2 , and python interpreter is working under it. second environment is using python 3.6.0, and python interpreter is not working under it. the error is "You selected an invalid Python interpreter for the console so the previous interpreter will stay. Please make sure to select a valid one."

for creating the kernels I used the following instruction: https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder the section: The modular approach

What steps reproduce the problem?

conda create -n myenv python=3.6 conda activate myenv conda install spyder-kernels python -c "import sys; print(sys.executable)" conda deactivate spyder

and following the procedure in modular approach

Paste Traceback/Error Below (if applicable)

You selected an invalid Python interpreter for the console so the previous interpreter will stay. Please make sure to select a valid one.


Spyder Internal Console

This console is used to report application
internal errors and to inspect Spyder
internals with the following commands:
  spy.app, spy.window, dir(spy)

Please don't use it to run your code

Versions

  • Spyder version: 4.1.2
  • Python version: 3.7.7
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: macOS Catalina - 10.15.4

Dependencies


# Mandatory:
applaunchservices >=0.1.7      :  0.2.1 (OK)
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.4.1 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.13.0 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  0.9.2 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.5.0 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.10 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  0.7.0 (OK)
qtconsole >=4.6.0              :  4.7.3 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.0.3 (OK)
spyder_kernels >=1.9.0;<1.10.0 :  1.9.0 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  18.1.1 (OK)

# Optional:
cython >=0.21                  :  0.29.17 (OK)
matplotlib >=2.0.0             :  3.1.3 (OK)
numpy >=1.7                    :  1.18.1 (OK)
pandas >=0.13.1                :  1.0.3 (OK)
scipy >=0.17.0                 :  1.4.1 (OK)
sympy >=0.7.3                  :  1.5.1 (OK)

eghbalhosseini avatar May 05 '20 18:05 eghbalhosseini

Hi @eghbalhosseini,

Can you please send me an screenshot to see which file is selected under Preferences > Python Interpreter?

steff456 avatar May 05 '20 21:05 steff456

spyder_python

eghbalhosseini avatar May 06 '20 00:05 eghbalhosseini

You need to determine your own Python interpreter using the one in the path of the environment you created.

Let me know if that works!

steff456 avatar May 06 '20 03:05 steff456

thanks. I am a bit confused though, I used the command sys.executable to get the following path, not sure how to get the path you are mentioning.

eghbalhosseini avatar May 06 '20 15:05 eghbalhosseini

I think this has to do with conda environment using python=3.6 . if I keep everything the same and only change the python version to 3.7 then the path works for spyder

eghbalhosseini avatar May 08 '20 16:05 eghbalhosseini

I think this has to do with conda environment using python=3.6

Yes, I think so too. It seems we're failing to do the proper validation for a Python interpreter when it's version is 3.6.

ccordoba12 avatar May 08 '20 23:05 ccordoba12

I'm getting this exact same issue, but for a conda environment with Python 3.8. It looks like there are plans to address this for Python 3.6. It may be worthwhile to address it for 3.8 as well?

RyleighFitz avatar Jun 03 '20 10:06 RyleighFitz

I think python 3.8 works for me in this case.

eghbalhosseini avatar Jun 08 '20 17:06 eghbalhosseini

We've been unable to reproduce this one, unfortunately.

ccordoba12 avatar Jun 18 '20 02:06 ccordoba12

I've ran into this issue today. I have a 3.7.9 Python virtualenv that I wanted to run from Spyder. The virutalenv is created by Anaconda via ArcGIS Pro.

When I select the python.exe from Spyder installed with Winpython64-3.9.1.0cod (which has Spyder 4.2.1) I get the following Invalid Path error, regardless of whether I select the path from the file explorer or paste it manually:

2021-02-06 11_58_03-Preferences

The same 3.7.9 Python environment is automatically detected and runs without a hitch with the VS Code that comes with the Winpy package.

When I select the exact same path in Spyder installed with Winpython64-3.7.7.1cod (which has Spyder 4.1.3) I do not get any error:

2021-02-06 11_56_20-Preferences

vdveen avatar Feb 06 '21 11:02 vdveen

Hey @vdveen, thanks for reporting. You said:

I've ran into this issue today. I have a 3.7.9 Python virtualenv that I wanted to run from Spyder. The virutalenv is created by Anaconda via ArcGIS Pro.

Could you let us know the exact command you used to create your virtualenv? That way we'll be able to run it on our side and try to reproduce your problem.

ccordoba12 avatar Feb 06 '21 17:02 ccordoba12

Hi! I can't, since I created the Python installation through the ArcGIS software GUI. I can however list all the packages, and I've created an environment.yaml file for that specific virtual env. Both are attached.

env.yaml conda list.txt

Would this suffice for your ability to reproduce the problem?

vdveen avatar Feb 08 '21 07:02 vdveen

Thanks @vdveen for the list. Unfortunately, it seems there are several packages that belong to the esri channel (I haven't heard of it), so this doesn't seem simple to reproduce. Since right now we are quite busy with other things, we don't have time to debug your problem, sorry.

ccordoba12 avatar Feb 10 '21 01:02 ccordoba12

@ccordoba12 How can you close this issue when people are still facing this issue ?

Still spyder is showing invalid path while changing the environment .

subrahamanya-Dhiomics avatar Jun 27 '22 08:06 subrahamanya-Dhiomics

I don't understand what you mean, the issue is open. But we don't know how to reproduce it.

ccordoba12 avatar Jun 27 '22 12:06 ccordoba12

I also encountered this problem when I was using python 3.6.1. Unfortunately, I have used all of the methods in the issue without success on my computer. I guess one possible reason is the lack of venvlauncher.exe in the Python 3.6 virtual environment. Hopefully this will help others with this problem.

fulequn avatar Nov 13 '22 02:11 fulequn