-
-
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, |
I did that, now Spyder 6 doesn't even launch, thanks. |
Try opening cmd and then type syder
…On Mon, Sep 23, 2024 at 11:49 AM emefff ***@***.***> wrote:
Hi, Same issue but I have updated all packages and it works perfectly now
with Spyder 6: pip list --outdated pip install pip-review pip-review
--local --auto
I did that, now Spyder doesn't even launch, thanks.
—
Reply to this email directly, view it on GitHub
<#22420 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADAYWTPQLKUEOC7VOH5Y7FTZX62ZBAVCNFSM6AAAAABNSWYTG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRXGM2TKMZYHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
With Warm Regards
*Muhammad Zeeshan Ahmed*
[image: images] <https://pk.linkedin.com/in/soonawan>
***@***.*** ***@***.***>*,
00 (971) 54 563 54 64
00 (92) 333 770 97 90
*Save Trees , Print Wisely*
This e-mail message may contain confidential or legally privileged
information and is intended only for the use of the intended recipient(s).
Any unauthorized disclosure, dissemination, distribution, copying or the
taking of any action in reliance on the information herein is prohibited.
E-mails are not secure and cannot be guaranteed to be error free as they
can be intercepted, amended, or contain viruses. Anyone who communicates
with me by e-mail is deemed to have accepted these risks. I am not
responsible for errors or omissions in this message and deny any
responsibility for any damage arising from the use of e-mail. Any opinion
and other statement contained in this message and any attachment are solely
those of the author.
|
Thank you ccordoba12 for your time to respond. I do not use any package managers nor do I even set up virtual environments (but I also keep env vars to a min). I have scripts to manage my packages using simply pip. Historically, this has worked better for me than package managers designed to simplify the ever increasing complexity of dependencies managements and version control. However, conda and miniconda have broken my setups more than my own scripts, but I do not wish that to become a focus. Suffice it to say, I do not use conda, miniconda or other package managers for Python at least (I do for C# so I am not simply deadset against package managers). I may have stumbled upon the solution tonight while also doing some coding on my girlfriends laptop that also experienced this same problem as my office PC. This demonstrated that the exact version of Windows was not the issue. Here is what worked for me: plt.switch_backend("inline"); # May not be necessary if you already have the backend set to 'inline' I am not sure if this will resolve the issue for others, but I am hopeful it helps someone. I do apologize that I do not have a more in depth knowledge of the matplotlib module, IPython or Spyder. I hope this may reach others with similar experience to mine and save them some frustration and time. As for the experts with the underlying code and "mechanics," I hope this post may guide a paradigm consistent with the ease of use that has made Python the leading languag of modern times. I am an old dog who grew up on Fortran, Pascal, C, and C++. Fortunately, I avoided Ada. LOL Python has been life-changing -- saving hours of times for what should have been simple tasks for years. Granted, C++ and the C Standard Templates were on a nice path towards similar simplicity, but Spectre and general concerns about novice programmers not watching their pointers carefully enough and frequently generating memory leakages led at least Microsoft to lockdown C++ a little tighter so that these productivity enhancements for C++ over the past decade+ now are not as helpful as they could be though they still are in Raspberrry Pi, Linux, RTOS, microcontrollers and near everything except Microsoft, and those more savey than I will know how to minimize the impediments to productivity in MSVC++, but now that Python is mature, I needn't know except for occassional CUDA codes or for some HPC management of in-memory solves with very large allocations of memory and efficient semiphores that don't waste clock cycles and some low-level tinkering with fans and tachometers and things that seem they should be far simpler to read and to adjust... and oh... occassionally I find myself with needs to write services and register services. All that is an aside. I am sorry for the lengthy aside.. Thanks. |
When opening Spyder from a command prompt it works here thanks.
|
Just wanted to report that updating
Starting |
@ougx, how did you install Spyder? And did you activate the right env (the one with the versions you posted above) before launching Spyder? |
I installed Soyder through mamba. Yes, I have activated the ENV with the latest updates.
|
Ok, please run these commands in the IPython console and post the results:
and post the results (you can upload a screenshot if you want). |
@hirennan, I guess you're connecting Spyder to an external environment because plots are working fine with the environment that comes with the installer. |
Thanks, @ccordoba12
Actually |
Thanks for the info @ougx! Your results were the ones I expected: they show the inline backend was not registered correctly. With that info I'll be able to solve this issue in 6.0.2, to be released in a week and a half. |
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: