spyder-ide / spyder

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

Spyder 5.3.3 not showing plots due to a VPN issue #20187

Open OrbitalMechanic opened 1 year ago

OrbitalMechanic commented 1 year ago

Issue Report Checklist

Problem Description

Running SPYDER-IDE (version 5.3.3) from the Annoconda Distribution for Python 3.9 on a Mac Pro (2019, Intel processor) under Mac OS X ver. 13.0.1 (Ventura). The provided below will not run. The only output I get is the message:

runfile('/Users/user/Various_Python_Examples/temp.py', wdir='/Users/user/Various_Python_Examples')

in the console window.

What steps reproduce the problem?

  1. Running on a Mac under Max OS X ver. 13.0.1 (Ventura) with the Intel Processor
  2. Installing the Mac OS X Intel processor version of the Anaconda Distribution for Python ver. 3.9
  3. Startup Anaconda-Navigator
  4. Run SPYDER ver. 5.3.3
  5. Use the test program provided below (you'll need to adjust the first line for your system)

What is the expected output? What do you see instead?

I ran the following test program:

#!/Users/user/opt/anaconda3/bin/python3
import matplotlib.pyplot as plt
import numpy as np
#plt.switch_backend('QT5Agg')
plt.style.use("ggplot")

t = np.arange(0.0, 2.0, 0.1)
s = np.sin(2 * np.pi * t)
s2 = np.cos(2 * np.pi * t)
plt.plot(t, s, "o-", lw=4.1)
plt.plot(t, s2, "o-", lw=4.1)
plt.xlabel("time (s)")
plt.ylabel("Voltage (mV)")
plt.title("Simple plot $\\frac{\\alpha}{2}$")
plt.grid(True)

plt.savefig("test.png")

plt.show()

expecting to see my plot appear in the IDE plot window. I got the following message in the console window instead:

runfile('/Users/user/Various_Python_Examples/temp.py', wdir='/Users/user/Various_Python_Examples')

Versions

Dependencies

# Mandatory:
applaunchservices >=0.3.0     :  0.3.0 (OK)
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.31.1;<8.0.0       :  7.31.1 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.16.0 (OK)
keyring >=17.0.0              :  23.4.0 (OK)
nbconvert >=4.0               :  6.4.4 (OK)
numpydoc >=0.6.0              :  1.5.0 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0;<3.0           :  2.14.5 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.5.0;<1.6.0          :  1.5.0 (OK)
pylsp_black >=1.2.0           :  1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0     :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=1.0.2             :  1.0.3 (OK)
qtconsole >=5.3.2;<5.4.0      :  5.3.2 (OK)
qtpy >=2.1.0                  :  2.2.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  65.5.0 (OK)
sphinx >=0.6.6                :  5.0.2 (OK)
spyder_kernels >=2.3.3;<2.4.0 :  2.3.3 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
zmq >=22.1.0                  :  23.2.0 (OK)

# Optional:
cython >=0.21                 :  0.29.32 (OK)
matplotlib >=3.0.0            :  3.6.2 (OK)
numpy >=1.7                   :  1.21.5 (OK)
pandas >=1.1.1                :  1.4.4 (OK)
scipy >=0.17.0                :  1.7.3 (OK)
sympy >=0.7.3                 :  1.11.1 (OK)

Is this an incompatibility with Mac OSX Ventura, a bug with version 5.3.3 of SPYDER, or what?

Please advise.

Sam Dupree.

ccordoba12 commented 1 year ago

Hey @OrbitalMechanic, thanks for reporting. You said

expecting to see my plot appear in the IDE plot window.

Plots in Spyder are displayed by default in its Plots pane, as described in our documentation.

If that pane is not visible in the interface, please go to the menu

View > Panes > Plots

to show it again. Let us know if it works for you.

I got the following message in the console window instead:

That is the command used to run a file in Spyder's IPython console.

OrbitalMechanic commented 1 year ago

The plot pane is set correctly. The problem is that SPYDER displays the message

runfile('/Users/user/Various_Python_Examples/temp.py', wdir='/Users/user/Various_Python_Examples')

but the script is never executed.

Sam Dupree.

ccordoba12 commented 1 year ago

The problem is that SPYDER displays the message

As I said, that is the command used by Spyder to run files. And this is what I get when running the code you posted above (you can see that the plot is shown just fine):

imagen

However, I see that you have this line

plt.title("Simple plot $\\frac{\\alpha}{2}$")

which requires Latex to work. Do you have Latex installed? If not, please comment it and try again.

OrbitalMechanic commented 1 year ago

I have Latex installed. I get the very same plot if and only if I run that script outside of Spyder in a terminal window using the:

python temp.py

Again as I mentioned before, I got the response:

runfile('/Users/user/Various_Python_Examples/temp.py', wdir='/Users/user/Various_Python_Examples')

with no further response whatsoever. It is almost as if execution ceases after displaying that message, i.e., the Python interpreter is not running. How should the Preferences be set?

Lastly, I noticed that the splash screen for Spyder goes away too quickly, and I'm not sure that all the packages it requires have been loaded.

Please advise.

Sam Dupree.

ccordoba12 commented 1 year ago

Ok, please post a screenshot of what you're seeing that includes the Editor, IPython console and Plots panes (like my screenshot above) to better understand what's happening in your case.

OrbitalMechanic commented 1 year ago

Attached is the screen snap you requested. This screen snap shows what happened when I started the same Python script I previously posted. You'll observe that the IPython console shows

runfile('/Users/user/Various_Python_Examples/temp.py', wdir='/Users/user/Various_Python_Examples')

No plot was produced.

Screenshot 2022-12-16 at 12 10 37
ccordoba12 commented 1 year ago

Thanks @OrbitalMechanic! Are you able to see In [2]: in the IPython console at some point? Or it just gets stuck at In [1]: runfile(... all the time?

OrbitalMechanic commented 1 year ago

It gets stuck there until I restart the console.

ccordoba12 commented 1 year ago

Ok, then please click the red square button to the top right of the console and post any error message displayed on it.

OrbitalMechanic commented 1 year ago

I pressed the red button at the top right of the console, and nothing happens.

OrbitalMechanic commented 1 year ago

After several tries, I finally got pressing the red button at the top right of the console to work by exiting Spyder, re-entering it, starting the Python script, and then interrupting the console (red button at the top right of the console). No error message appeared.

Screenshot 2022-12-16 at 13 05 03
ccordoba12 commented 1 year ago

Ok, I see that you have both the Pylab and Sympy options enabled in

Preferences > IPython console > Graphics > Support for graphics

and

Preferences > IPython console > Advanced settings > Symbolic mathematics

respectively.

So, please disable them and try again. Perhaps that will solve your problem.

OrbitalMechanic commented 1 year ago

I disabled the Pylab and Sympy options, and still, nothing happened.

Screenshot 2022-12-16 at 17 52 36
ccordoba12 commented 1 year ago

Ok, then please close Spyder, open a terminal and run these commands there

conda create -n spyder-env -c conda-forge python=3.9 spyder matplotlib
conda activate spyder-env
spyder

After Spyder is up again, run your code there to see what happens.

OrbitalMechanic commented 1 year ago

I created spyder-env per your procedure.

The dependencies table follows.

# Mandatory:
applaunchservices >=0.3.0     :  0.3.0 (OK)
atomicwrites >=1.2.0          :  1.4.1 (OK)
chardet >=2.0.0               :  5.1.0 (OK)
cloudpickle >=0.5.0           :  2.2.0 (OK)
cookiecutter >=1.6.0          :  2.1.1 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.0.2 (OK)
IPython >=7.31.1;<8.0.0       :  7.33.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.2 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.17.3 (OK)
keyring >=17.0.0              :  23.11.0 (OK)
nbconvert >=4.0               :  7.2.6 (OK)
numpydoc >=0.6.0              :  1.5.0 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.4 (OK)
pygments >=2.0                :  2.13.0 (OK)
pylint >=2.5.0;<3.0           :  2.15.9 (OK)
pylint_venv >=2.1.1           :  2.3.0 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.6.0;<1.7.0          :  1.6.0 (OK)
pylsp_black >=1.2.0           :  1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0     :  3.0.3 (OK)
qstylizer >=0.2.2             :  0.2.2 (OK)
qtawesome >=1.2.1             :  1.2.1 (OK)
qtconsole >=5.4.0;<5.5.0      :  5.4.0 (OK)
qtpy >=2.1.0                  :  2.3.0 (OK)
rtree >=0.9.7                 :  1.0.1 (OK)
setuptools >=49.6.0           :  65.5.1 (OK)
sphinx >=0.6.6                :  5.3.0 (OK)
spyder_kernels >=2.4.0;<2.5.0 :  2.4.0 (OK)
textdistance >=4.2.0          :  4.5.0 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.2.0 (OK)
zmq >=22.1.0                  :  24.0.1 (OK)

# Optional:
cython >=0.21                 :  None (NOK)
matplotlib >=3.0.0            :  3.6.2 (OK)
numpy >=1.7                   :  1.23.5 (OK)
pandas >=1.1.1                :  None (NOK)
scipy >=0.17.0                :  None (NOK)
sympy >=0.7.3                 :  None (NOK)

When I ran Spyder from a terminal, I got the following response:

(spyder-env) user@Mac-Pro ~ % spyder
The available OpenGL surface format was either not version 3.2 or higher or not a Core Profile.
Chromium on macOS will fall back to software rendering in this case.
Hardware acceleration and features such as WebGL will not be available.
fromIccProfile: failed minimal tag size sanity

Lastly, I got the same results as before:

image
ccordoba12 commented 1 year ago

Ok, please close Spyder, open a terminal, run there

spyder --reset

and try again.

OrbitalMechanic commented 1 year ago

From the terminal:

*** Reset Spyder settings to defaults ***
removing: /Users/user/.spyder-py3/help
removing: /Users/user/.spyder-py3/onlinehelp
removing: /Users/user/.spyder-py3/path
removing: /Users/user/.spyder-py3/temp.py
removing: /Users/user/.spyder-py3/template.py
removing: /Users/user/.spyder-py3/history.py
removing: /Users/user/.spyder-py3/history_internal.py
removing: /Users/user/.spyder-py3/workingdir
removing: /Users/user/.spyder-py3/langconfig
removing: /Users/user/.spyder-py3/spyder.lock
removing: /Users/user/.spyder-py3/config/spyder.ini
removing: /Users/user/.spyder-py3/config/transient.ini
removing: /Users/user/.spyder-py3/plugins
(spyder-env) user@Mac-Pro ~ % spyder         
The available OpenGL surface format was either not version 3.2 or higher or not a Core Profile.
Chromium on macOS will fall back to software rendering in this case.
Hardware acceleration and features such as WebGL will not be available.
fromIccProfile: failed minimal tag size sanity
2022-12-17 21:44:38.756 python[9418:2063155] +[CATransaction synchronize] called within transaction
(spyder-env) user@Mac-Pro ~ % 

This time Spyder showed a splash page for the online tutorial. Closing that and continuing to execute, I got the following splash page:

Screenshot 2022-12-17 at 21 45 39

Clicking Run, I got no change from before:

Screenshot 2022-12-17 at 21 46 17
ccordoba12 commented 1 year ago

Sorry, I'm out of ideas. Perhaps this is an odd issue only present in Ventura, something not uncommon on new Mac versions and a reason why you should wait at least six months before updating to a new OS version for the next time.

@mrclary, could you take a look at this one, of course, if you're in Ventura?

mrclary commented 1 year ago

which requires Latex to work. Do you have Latex installed? If not, please comment it and try again.

@ccordoba12, FYI, matplotlib has its own LaTeX rendering engine, so LaTeX is not required to be installed on the users system.

mrclary commented 1 year ago

Sorry, I'm out of ideas. Perhaps this is an odd issue only present in Ventura, something not uncommon on new Mac versions and a reason why you should wait at least six months before updating to a new OS version for the next time.

@mrclary, could you take a look at this one, of course, if you're in Ventura?

I'll take a look at it as soon as I have Ventura installed on my iMac. Perhaps this week.

ccordoba12 commented 1 year ago

@ccordoba12, FYI, matplotlib has its own LaTeX rendering engine, so LaTeX is not required to be installed on the users system.

Yep, I know, but it's only able to render a subset of Latex, so I thought that could the problem in this case.

I'll take a look at it as soon as I have Ventura installed on my iMac. Perhaps this week.

Great! Thanks for your help.

mrclary commented 1 year ago

Unfortunately, I cannot reproduce the OP.

I've tried several different launch scenarios:

issue-20187

OrbitalMechanic commented 1 year ago

I mentioned previously that when the splash screen for Spyder appears, there is no indication that it is loading anything. Could this be a clue as to what is happening? Furthermore, is there a way to find out what Spyder loaded on startup?

mrclary commented 1 year ago

@OrbitalMechanic, one thing you could try is running Spyder in debug mode. Using the spyder-env conda environment again

(spyder-env) $ spyder --debug-info=verbose

Then run your script. Afterward, you may quit Spyder. The debug log messages will appear in the Terminal, but also sent to ~/.spyder-py3/spyder-debug.log. Attach this file to a comment or copy and paste the contents into the comment. This may give us a clue as to what is going on.

OrbitalMechanic commented 1 year ago

Attached is the log file, as you requested.

spyder-debug.log

mrclary commented 1 year ago

Well, unfortunately I don't see anything amiss in the log file... @ccordoba12, do you have any other ideas?

mrclary commented 1 year ago

@OrbitalMechanic maybe try updating from macOS 13.0.1 to 13.1?

ccordoba12 commented 1 year ago

do you have any other ideas?

According to @OrbitalMechanic's logs, the comm channel was never connected, which should be the cause for this problem. Since the kernel appears to be connected, that could be a proxy, firewall or VPN issue. @OrbitalMechanic, please try to disable them (if you have them enabled) and try again.

OrbitalMechanic commented 1 year ago

It was the VPN that caused the problem. However, once I disabled it, both spyder-env and spyder under Anaconda-Navigator ran fine.

The issue now is how to get spyder and my VPN to work together, so let me ask this question: would there be a problem between a standalone version of spyder installed in the application folder versus the spyder installed under Anaconda-Navigator? If I can get a standalone version of spyder installed in the Application folder, then I can add the standalone spyder to my VPN split tunnel list.

Where would I find a version of spyder compatible with Mac OSX Ventura for the Intel processor to install?

mrclary commented 1 year ago

@OrbitalMechanic, the latest Spyder releases can be downloaded here: https://github.com/spyder-ide/spyder/releases/tag/v5.4.0 I recommend the Spyder.dmg standalone installer.

I don't know if this will resolve your issue or not. What VPN service and/or settings are you using? I must use a VPN for my day job and have not had any issues with Spyder.

OrbitalMechanic commented 1 year ago

I'm running hide.me The setting I'm using follows.

Are there particular settings that would impact spyder?

mrclary commented 1 year ago

hide.me does not seem to have a free trial so I could not test with it, but I was able to use Proton VPN without any affect on Spyder. My employer requires me to use another VPN which also does not affect Spyder. So I wonder if it is something unique to hide.me.

OrbitalMechanic commented 1 year ago

From what I can see, it's something about hide.me that impacts spyder. There is a free version of hide.me, as depicted in the screen snap below.

Screenshot 2022-12-20 at 15 53 33

As for Proton VPN, do you know if their implementation of split tunneling works for Mac OSX Ventura?

mrclary commented 1 year ago

@OrbitalMechanic I cannot reproduce the OP, even with hide.me. I've tried several different settings:

ccordoba12 commented 1 year ago

Where would I find a version of spyder compatible with Mac OSX Ventura for the Intel processor to install?

Spyder 6 should solve this by not setting a special port for comms. Instead, we'll use a regular Jupyter port for that.

We'll release the first Spyder 6 alpha in two months or so. Other than that, I think there's little we can do about this.

OrbitalMechanic commented 1 year ago

Here is what I've observed.

The takeaway here is to run Spyder (stand-alone or installed under Anaconda-Navigator) in "full tunneling" mode for the time being.

OrbitalMechanic commented 1 year ago

Gentlemen, I sincerely appreciate your help in isolating this problem and identifying a solution.

Please inform me when Spyder 6 alpha becomes available.

Once again, thanks for all your help.

Sam Dupree.

mrclary commented 1 year ago

@OrbitalMechanic, I assume that you did not have any problems with hide.me split-tunneling and Spyder in previous versions of macOS. Is this correct?

Also, even with split tunneling ("Only allow selected apps to use the VPN", Spyder not listed), I still cannot reproduce the OP. But I'm glad you've found a work-around for now.

ccordoba12 commented 1 year ago

Please inform me when Spyder 6 alpha becomes available.

Will do

But I'm glad you've found a work-around for now.

Agreed.