-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plots not showing in Spyder 6 using external Python interpreter #22420
Comments
I am having this same exact problem and it also broke my Spyder 5.5.4 installation's ability to show plots. I have tried uninstalling and reinstalling Spyder 5.5.6, 5.5.5, and 5.5.4 and none of the versions worked. I have tried re-creating my conda environment and that didn't work. I have tried removing the .spyder-py3 settings folder and that didn't work. What could have permanently changed on my machine to permanently break plotting with a different python interpreter? I cannot work if I cannot generate plots. Here is my conda environment: |
When I update spyder to 6, I have same problem. |
Depending on how you all installed, I managed to "fix" it by just downgrading via "pip install spyder=5.5.6" via the pip installation. |
Hi all, I have tested that when I create a new environment, after installing spyder-kernels 3.0, everything works fine. I have already checked that the environment I have issues with, has the updated versions of: spyder-kernels, matplotlib, matplotlib-inline, python 3.9, ipykernel. So, apparently, there is a conflict with some other package(s) installed there. If you want to use the latest version of Spyder, and you face similar issues, I guess the most straightforward solution is creating a new environment with spyder-kernels 3, and reinstall there any extra packages you may need. |
Thanks for sharing. I did make a new conda environment from a yml file, but that still didn't work. Would you mind sharing your conda environment so I can see what may be different with mine? |
Environments typically have hundreds of packages, and it's not obvious which packages are related to this issue. I have deleted the testing one I created, but you can create a similar one using
First, open spyder, create a console in this new environment, and test if the plots are working properly, with something like:
If it works, then you can re-install there the rest of the packages you need, or you can export the packages of the new evironment, and check their installed versions. |
Hi everyone and thank you for the reports and feedback posted here! I would say as @angelo-ml that seems like there is some sort of version incompatibility causing issues here. Checking as @tlstevenson pointed this maybe is related with #22224 It would be nice to trace the specific packages combination causing this behavior and @angelo-ml suggestion (creating a new env, checking if the plots work or not while re-installing needed packages one by one) could help. If anyone runs this kind of test let us know! |
I have tried this with python 3.10, 3.11, and 3.12 and none of them worked. I even tried updating IPython to 8.27.0 as mentioned here and that didn't work as well. Perhaps there is some other package that needs to be updated to work? @angelo-ml would you mind creating a basic environment that works on your end and sharing the installed packages so I can compare with mine? |
Okay, I have figured out what was wrong in my own environments! All I had to do was update matplotlib-inline from 0.1.6 (the default installed by miniconda) to 0.1.7. I hope this helps someone else! |
Thanks a lot, I managed to reproduce the issue with that hint. For the record, here are the versions that I tried and their result (no other packages changed except for matplotlib-base which always has the same version as matplotlib):
Looking at the changes in matplotlib-inline, the only relevant one seems to be ipython/matplotlib-inline#34. |
IF you run ipython --matplotlib qt directly on windows powershell it will draw it. But not from Spyder v6 `import matplotlib.pyplot as plt plt.figure(figsize=(10, 6)) |
I am seeing the same problem with Jupyter Lab. If I install matplotlib 3.9.1 and matplotlib-inline 0.1.6 then the following code (from the matploblib-inline readme) in a notebook does not show a plot:
@ccordoba12 Is it worthwhile to report this as an issue to the Jupyter people? |
Let me think about it and I'll let you know. We should be able to submit a PR upstream to fix this. |
I am also having the same issue. These are the basic specs of my environment: Python 3.11 Downgrading to 5.5.6 with pip install --upgrade "spyder==5.5.6" fixes it for the time being. |
Update all packages specially Matplotlib, plotly etc It works , use
Open a command shell by typing ‘powershell’ in the Search Box of the Task bar
|
I tried the combination of matplotlib 3.9.1, matplotlib-inline 0.1.7 but the issue seems to persist for me |
@hirennan, you also need to update IPython (8.27.0) to its latest version to work with the latest matplotlib and matplotlib-inline versions. Please do that and report back. |
I am using matplotlib 3.9.2, matpltolib-inline 0.1.7, ipython 8.27.0 and spyder 6.0.0 and on my personal laptop (i3-5020U running Win 10 Home 22H2 19045.4894) and my office PC (i9-7900X Win 10 Pro 22H2 19045.4170) and plots still work on my personal laptop (in the theme of this thread -- "do not work" translates to "do not plot in the Spyder IDE"), they do not work on my office PC. I rolled back the matplotlib and matplotlib-inline to a few versions on separate attempets to no avail. I tried rolling back Spyder. When I roll back Spyder to 5.5.6, it works on my office PC regardless of combinations of matplotlib, matplotlib-inline and ipython (at least with respect to all combination of versions within the past year). Matplotlib does not work in any of the Spyder 6 release candidates on my office PC. Again, on my personal laptop, Spyder 6 and matplotlib play nice together. Could this be due to my office using the stable enterprise edition of Windows which lags a bit -- version 19045.4170 vs 19045.4894? Would there be any GP settings keeping any of the modules from properly installing (I believe this is normally only the case for things like the NVidia CUDA modules which compile for machine-specific configurations, like cupy, but I may be wrong, and I even learned a means to compile cupy that makes my GP happy, eseentially I was initially oversimplifiying the process expecting niavely 'pip install cupy' to work or 'pip install cupy-cuda117' to work. It wasn't that simple but not difficult either). |
@ccordoba12 I updated IPython to the latest version (8.27.0) but I was still unable to view plots. Finally, downgraded from Spyder 6.0.0 to 5.5.6 and the issue seems to be resolved |
@hirennan or @RocketCityElectromagnetics, could you try our Windows installer? The error shouldn't be present in it. |
@ccordoba12 Im on a macos machine, so I can't run the windows installer. Please me know if there's anything I can help with |
Sorry, then please download ans install Spyder using our Mac installer (you can grab it from the same link I posted above). |
@ccordoba12 I should've mentioned this earlier but I installed Spyder 6.0 via the Mac installer. When I downgraded to 5.5.6 (currently on) I did it via the Mac installer available on the releases page. Please find the matplotlib and other relevant packages versions being used currently below
|
Hi, |
Hey, I installed the new Spyder 6. I set it up as usual with my existing Python interperter and installed all spyder dependcies as usual. However, for some reason, inline graphics with matplotlib no longer works for me.
When I try plotting with TK, a figure does pop up, but it gets frozen and nothing shows.
I'm using Python 3.12. This is the same python version I was using with Spyder 5.
Thanks!
The text was updated successfully, but these errors were encountered: