You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating conda conda update --all calling plt.subplots() in Spyder crashes the IPython kernel. Outside of Spyder plt.show() this does not happen, but there plt.show() seems to crash Python.
How to reproduce
Install Miniconda on Windows.
Create a test environment: conda create -n testenv -c conda-forge spyder matplotlib && conda activate testenv
Run mpltest2 from the command line: python mpltest2.py (Runs fine.)
Update the test environment: conda update --all
This should install blis and update intel-openmp and mkl:
Package plan
(testenv) C:\Users\wilde\Desktop\temp\spydertest>conda update --all
Channels:
- conda-forge
- defaults
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: C:\Users\wilde\miniconda3\envs\testenv
The following packages will be downloaded:
package | build
---------------------------|-----------------
blis-0.9.0 | hcfcfb64_1 3.2 MB conda-forge
intel-openmp-2024.0.0 | h57928b3_49840 2.2 MB conda-forge
libblas-3.9.0 | 20_win64_blis 1.5 MB conda-forge
libcblas-3.9.0 | 20_win64_blis 1.5 MB conda-forge
liblapack-3.9.0 |5_hd5c7e75_netlib 2.7 MB conda-forge
mkl-2024.0.0 | h66d3029_49657 103.5 MB conda-forge
------------------------------------------------------------
Total: 114.7 MB
The following NEW packages will be INSTALLED:
blis conda-forge/win-64::blis-0.9.0-hcfcfb64_1
The following packages will be UPDATED:
intel-openmp 2023.2.0-h57928b3_50497 --> 2024.0.0-h57928b3_49840
mkl 2023.2.0-h6a75c08_50497 --> 2024.0.0-h66d3029_49657
The following packages will be DOWNGRADED:
libblas 3.9.0-20_win64_mkl --> 3.9.0-20_win64_blis
libcblas 3.9.0-20_win64_mkl --> 3.9.0-20_win64_blis
liblapack 3.9.0-20_win64_mkl --> 3.9.0-5_hd5c7e75_netlib
Open mpltest1 in Spyder and run it.
Fails with "access violation", the IPython kernel restarts.
Error messages
In[1]: runfile('C:/Users/wilde/Desktop/temp/spydertest/spydertest.py', wdir='C:/Users/wilde/Desktop/temp/spydertest')
Windows fatal exception: access violation
Windows fatal exception: access violation
Windows fatal exception: access violationThread 0x00000c20
Windows fatal exception: access violation
(most recent call first):
Windows fatal exception: File access violation"
C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\ipykernel\parentpoller.pyWindows fatal exception: access violation"
, line 93 in Windows fatal exception: access violationrun
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\threading.py", line 1073 in _bootstrap_inner
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\threading.py", line 1030 in _bootstrap
Main thread:
Thread 0x00004a70 (most recent call first):
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\transforms.py", line 2436 in get_affine
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\transforms.py", line 2437 in get_affine
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\patches.py", line 587 in draw
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\artist.py", line 72 in draw_wrapper
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\figure.py", line 3153 in draw
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\artist.py", line 72 in draw_wrapper
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\artist.py", line 95 in draw_wrapper
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\backends\backend_agg.py", line 388 in draw
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\backend_bases.py", line 1893 in draw_idle
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\_pylab_helpers.py", line 132 in draw_all
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\matplotlib\pyplot.py", line 197 in _draw_all_if_interactive
File "C:\Users\wilde\miniconda3\envs\testenv\Lib\site-packages\IPython\core\events.py", line 82 in trigger
Restarting kernel...
Run mpltest2 from the command line: python mpltest2.py
This also fails. A plot window briefly opens but then closes without showing any axes. "Hello World!" is never printed.
Additional information
I am not completely sure that this is something matplotlib can/should fix, it happens after updating other packages, after all. However, I don't know enough to locate the bug any further or to reproduce it without matplotlib and don't know where else to report it. Feel free to point me to the correct place if this is not it.
The error I am getting is similar to that discussed in #21511. However, that was due to a change in freetype which is not the case here.
Operating system
Windows
Matplotlib Version
3.8.2
Matplotlib Backend
QtAgg
Python version
Python 3.12.1
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered:
Please isolate to installing Matplotlib and/or take up with spyder and ipympl. You've got too many possible things here that could be going wrong and the fact it only crashes in spyder doesn't make it sound like it is a Matplotlib issue.
@jklymak But it doesn't only crash in Spyder; that's why I included mpltest2 for running in bare Python. Only there I don't get any error messages, just a crash. In Spyder at least some (hopefully useful) information is displayed.
To make sure, I repeated the procedure without Spyder (same steps as above for mpltest2):
is the code that is failing. Given that this is a segfault and in a np.dot call my guess is that this is actually failing in the numpy c extensions. This is likely because you end up with incompatible versions of blas/lapack.
The thing that I find very confusing is that conda upgrade --all changes a freshly installed environment. Are you ending up crossing the defaults and cf channels? If anything, I think this should be a bug reported to anaconda as it is installing a set of incompatible packages.
Bug summary
After updating conda
conda update --all
callingplt.subplots()
in Spyder crashes the IPython kernel. Outside of Spyderplt.show()
this does not happen, but thereplt.show()
seems to crash Python.How to reproduce
Install Miniconda on Windows.
Create a test environment:
conda create -n testenv -c conda-forge spyder matplotlib && conda activate testenv
Create two test files.
mpltest1.py
:mpltest2.py
:Open
mpltest1
in Spyder and run it. (Runs fine.)Run
mpltest2
from the command line:python mpltest2.py
(Runs fine.)Update the test environment:
conda update --all
This should install
blis
and updateintel-openmp
andmkl
:Package plan
Open
mpltest1
in Spyder and run it.Fails with "access violation", the IPython kernel restarts.
Error messages
Run
mpltest2
from the command line:python mpltest2.py
This also fails. A plot window briefly opens but then closes without showing any axes.
"Hello World!"
is never printed.Additional information
I am not completely sure that this is something
matplotlib
can/should fix, it happens after updating other packages, after all. However, I don't know enough to locate the bug any further or to reproduce it withoutmatplotlib
and don't know where else to report it. Feel free to point me to the correct place if this is not it.The error I am getting is similar to that discussed in #21511. However, that was due to a change in
freetype
which is not the case here.Operating system
Windows
Matplotlib Version
3.8.2
Matplotlib Backend
QtAgg
Python version
Python 3.12.1
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered: