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
{{ message }}
Repository navigation
No output from pyplot on cygwin64 python3 virtualenv #5962
How did you install/build matplotlib? Chances are, if you built it from
source, then you didn't have the gui headers available, so it fell back to
a default of the headless AGG backend.
I installed using pip install matplotlib. Is there a particular set of libraries or dev packages I should be looking for to install?
Some kind of warning or something would be nice, when it's defaulting to a perceived inoperable mode.
give you? My guess is that it is going to say 'Agg', which is a non interactive backend. My guess is that you are missing a gui-toolkit wrapping library.
What should I have available for it to use something else?
It would be nice if there were some kind of prompt or message to indicate defaulting to a non-functional (from user perspective) behavior.
Initially when I installed matplotlib-2.0.0 in python-2.7 which is working fine.
But when I moved to python-3.4.5 suddenly the sample applications also stopped working.
After looking into dependencies and found out that the python3-tkinter backend was missing.
After installing all the dependencies and rebuilding I am getting this error:
It seems while importing the _tkagg package it looks for the _tkagg.dll
Is there a way I can suppress the "cpython-34m" in the generated library? or
Should I file a bug request at Cygwin for reporting this behaviour for the build?
Note: I am using pip3 for managing the python libraries.
Update: It was too pre-mature comment on my end, even after renaming the '_tkagg.cpython-34m.dll' to '_tkagg.dll' I am seeing the same error mentioned above.
I am facing exactly same kind of issue after trying to build Matplolib (v2.0.2 & v2.1.0).
Build is successfull but Import _tkagg fails
Could you provide us some guidelines in order to be able to use this module?
Which dependencies are exactly required?
Note: I am working from Cygwin 2.9.0 (x64) + Python 3.6.1
Same RuntimeError here from an install on Cygwin 64-bit via pip3 install --home matplotlib
$ uname -a
CYGWIN_NT-10.0 <hostname> 2.10.0(0.325/5/3) 2018-02-02 15:16 x86_64 Cygwin
$ ipython3
Python 3.6.4 (default, Jan 7 2018, 15:53:53)
In [1]: import matplotlib
In [6]: matplotlib.__version__
Out[6]: '2.2.2'
In [7]: import matplotlib.pyplot as plt
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-7-eff513f636fd> in <module>()
----> 1 import matplotlib.pyplot as plt
/home/lharcke/.local/lib/python3.6/site-packages/matplotlib/pyplot.py in <module>()
113 ## Global ##
114
--> 115 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
116
117 _IP_REGISTERED = None
/home/lharcke/.local/lib/python3.6/site-packages/matplotlib/backends/__init__.py in pylab_setup(name)
60 # imports. 0 means only perform absolute imports.
61 backend_mod = __import__(backend_name, globals(), locals(),
---> 62 [backend_name], 0)
63
64 # Things we pull in from all backends
/home/lharcke/.local/lib/python3.6/site-packages/matplotlib/backends/backend_tkagg.py in <module>()
2
3 from .. import cbook
----> 4 from . import tkagg # Paint image to Tk photo blitter extension.
5 from .backend_agg import FigureCanvasAgg
6 from ._backend_tk import (
/home/lharcke/.local/lib/python3.6/site-packages/matplotlib/backends/tkagg.py in <module>()
7 import numpy as np
8
----> 9 from matplotlib.backends import _tkagg
10
11 def blit(photoimage, aggimage, bbox=None, colormode=1):
RuntimeError: No such process
In [8]: import tkinter
In [9]: tkinter.TkVersion
Out[9]: 8.6
In [10]: tkinter.TclVersion
Out[10]: 8.6
Now to test tkinter:
In [1]: import tkinter
In [2]: root = tkinter.Tk()
In [3]: w = tkinter.Label(root, text="hello, world.")
In [4]: w.pack()
In [5]: root.mainloop()
[Window pops up with "hello, world." text]
Here's the matplotlib back end:
In [8]: print(matplotlib.get_backend())
TkAgg
So, tkinter seems to be installed properly, and the "hello, world." example works. But interactive plotting with matplotlib fails.
Can also generate the error simply by issuing:
In [11]: from matplotlib.backends import _tkagg
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-11-874272889e03> in <module>()
----> 1 from matplotlib.backends import _tkagg
RuntimeError: No such process
But then https://matplotlib.org/users/installing.html says:
Optionally, you can also install a number of packages to enable better user interface toolkits. See What is a backend? for more details on the optional Matplotlib backends and the capabilities they provide.
tk (>= 8.3, != 8.6.0 or 8.6.1): for the TkAgg backend;
PyQt4 (>= 4.4) or PySide: for the Qt4Agg backend;
PyQt5: for the Qt5Agg backend;
pygtk (>= 2.4): for the GTK and the GTKAgg backend;
wxpython (>= 2.9 or later): for the WX or WXAgg backend;
cairocffi (>= v0.8): for cairo based backends;
pycairo: for GTK3Cairo;
Tornado: for the WebAgg backend;
So maybe matplotlib Just Doesn't Work with Tk version 8.6 (why not?)
On Wed, Jun 27, 2018 at 7:19 PM, lharcke ***@***.***> wrote:
$ uname -a
CYGWIN_NT-10.0 <hostname> 2.10.0(0.325/5/3) 2018-02-02 15:16 x86_64 Cygwin
$ ipython3
Python 3.6.4 (default, Jan 7 2018, 15:53:53)
In [1]: matplotlib.__version__
Out[1]: '2.2.2'
In [7]: import matplotlib.pyplot as plt
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-7-eff513f636fd> in <module>()
----> 1 import matplotlib.pyplot as plt
/home/lharcke/.local/lib/python3.6/site-packages/matplotlib/pyplot.py in <module>()
113 ## Global ##
114
--> 115 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
116
117 _IP_REGISTERED = None
/home/lharcke/.local/lib/python3.6/site-packages/matplotlib/backends/__init__.py in pylab_setup(name)
60 # imports. 0 means only perform absolute imports.
61 backend_mod = __import__(backend_name, globals(), locals(),
---> 62 [backend_name], 0)
63
64 # Things we pull in from all backends
/home/lharcke/.local/lib/python3.6/site-packages/matplotlib/backends/backend_tkagg.py in <module>()
2
3 from .. import cbook
----> 4 from . import tkagg # Paint image to Tk photo blitter extension.
5 from .backend_agg import FigureCanvasAgg
6 from ._backend_tk import (
/home/lharcke/.local/lib/python3.6/site-packages/matplotlib/backends/tkagg.py in <module>()
7 import numpy as np
8
----> 9 from matplotlib.backends import _tkagg
10
11 def blit(photoimage, aggimage, bbox=None, colormode=1):
RuntimeError: No such process
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5962 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-NRI2uUx8G6SR4WwP9v150LSzXuZks5uBBMPgaJpZM4HSDVD>
.
Python3. pip3, Tcl/Tk and Tkinter were installed via the Cygwin package manager. Matplotlib is not packaged for Cygwin, so I did:
pip3 install --home matplotlib
It would seem there is a known incompatibility between Matplotlib and Tk version 8.6, but the pip3 install doesn't check and warn about Tk 8.6 incompatibility and disable TkAgg if Tk 8.6 is present when attempting to build/install the TkAgg interface. At least nothing appeared on the command line during a pip3 install --home matplotlib install. It is possible if I threw the -v switch, there might have been some sort of warning generated.
Remotely possible, as I have an Anaconda 4.2 Windows installation with Tkinter in C:\Program Files\Anaconda3\. But that would be very weird. Usually programs running under Cygwin ignore everything outside of the C:\cygwin64\ root directory. The pseudo-UNIX environment doesn't really permit programs to look above the pseudo-UNIX filesystem root, unless they explicitly try to access the mount point /cygdrive/c/. But UNIX programs generally don't know about the /cygdrive/c/ mount point, unless they are written specifically as Cygwin utilities/applications.
Anyway, Matplotlib isn't packaged for Cygwin, and a pip3 install of Matplotlib doesn't work out of the box for some reason (most likely Tk 8.6 incompatibility), which isn't flagged/reported during the pip3 build/install.
So, here's the bit from setupext.py where the TkAgg build is prepared:
class BackendTkAgg(OptionalBackendPackage):
name = "tkagg"
force = True
def check(self):
return "installing; run-time loading from Python Tcl / Tk"
def runtime_check(self):
""" Checks whether TkAgg runtime dependencies are met
"""
try:
import tkinter
except ImportError:
return False
return True
[snip]
def add_flags(self, ext):
ext.include_dirs.insert(0, 'src')
if sys.platform == 'win32':
# PSAPI library needed for finding Tcl / Tk at run time
ext.libraries.extend(['psapi'])
elif sys.platform == 'linux':
ext.libraries.extend(['dl'])
From static inspection, on current Cygwin, tkinter will load when runtime_check() is called. But it would appear that the add_flags() method will fail to add a dynamic linker for Cygwin, as on Cygwin, the call to sys.platform returns
In [1]: import sys
In [2]: sys.platform
Out[2]: 'cygwin'
and cygwin is not in the if/elif check for dynamic linker flags.
Glancing through the rest of the installer script, it appears there are many tests of sys.platform for w32, darwin, linux, sunos5, aix5 and such, but none for cygwin. Also, there doesn't appear to be a check for specific versions of Tcl/Tk anywhere in the code.
My guess at the bugfix is someone would have to spend some time editing the setupext.py script to add cygwin as a specific supported flavor of UNIX, and also to beef up the version number checking for Tcl/Tk, if indeed the Tk requirement is >= 8.3 but not 8.6 or 8.6.1 per the Matplotlib install webpage. I do not see the general mechanism where the matplotlib installer script checks/verifies version numbers of dependencies.
Hello! Just hit the same problem and using the git master branch figured out what's wrong. Apparently Windows doesn't provide for RTLD_LOCAL / RTLD_GLOBAL semantics , so Cygwin's dlsym() against /usr/lib/python3.6/lib-dynload/_tkinter.cpython-36m-x86_64-cygwin.dll fails to locate Tk_FindPhoto symbol, which is in fact declared in /usr/bin/libtk8.6.dll, despite all the dependencies are in place.
It looks like we'll have to use Windows-native mechanism for symbol lookup for Cygwin.
@tacaswell I've sucessfully verified that you can use native Windows API, the same as for "raw" Win32 platform. In src/_tkagg.cpp you have several #ifdef _WIN32. Those ones related to symbol loading should become #if defined(_WIN32) || defined(CYGWIN). And link against psapi library for cygwin platform. Yes, Cygwin apps are not advised to use WinAPI directly, but you're using it with care here. :) An alternate solution would be to implement POSIX behavior in cygwin1.dll; and i'm not sure how difficult it would be. At least there's no quick solution to that.
Bear in mind that GetForegroundWindow/SetForegroundWindow should stay _WIN32-only since Cygwin, being an "honest" POSIX, uses X Window API for graphics.
I wrote a Python program that worked under cygwin python3.7 from late April through the end of May. I ran it again today and got the exact same error described here.
I can't tell you what backend it's using because:
$ python3
Python 3.7.7 (default, Apr 10 2020, 07:59:19)
[GCC 9.3.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> print(matplotlib.get_backend())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.7/site-packages/matplotlib/__init__.py", line 1302, in get_backend
return rcParams['backend']
File "/usr/lib/python3.7/site-packages/matplotlib/__init__.py", line 831, in __getitem__
from matplotlib import pyplot as plt
File "/usr/lib/python3.7/site-packages/matplotlib/pyplot.py", line 2282, in <module>
switch_backend(rcParams["backend"])
File "/usr/lib/python3.7/site-packages/matplotlib/__init__.py", line 832, in __getitem__
plt.switch_backend(rcsetup._auto_backend_sentinel)
File "/usr/lib/python3.7/site-packages/matplotlib/pyplot.py", line 204, in switch_backend
switch_backend(candidate)
File "/usr/lib/python3.7/site-packages/matplotlib/pyplot.py", line 221, in switch_backend
backend_mod = importlib.import_module(backend_name)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/lib/python3.7/site-packages/matplotlib/backends/backend_tkagg.py", line 1, in <module>
from . import _backend_tk
File "/usr/lib/python3.7/site-packages/matplotlib/backends/_backend_tk.py", line 22, in <module>
from . import _tkagg
RuntimeError: No such process
I didn't use Python for anything else since the last time I ran my program.
I did, however, run Cygwin's auto-update several times since then.
I definitely also ran Cygwin's auto-update sometime in May, before running my program successfully.
So some Cygwin update released in May or June is causing this error again.
I recall that, in April, I initially installed python 3.8, but uninstalled it because I couldn't get seaborn to work. I don't remember if it was the same _tkagg error.
@philgoetz Try re-installing Matplotlib (you have have changed Tk under it?). If that fails can you try pip install --upgrade --pre matplotlib to try out 3.3.0rc1 which has the changes that closed this issue.
I found this comment on stackoverflow by me, describing the earlier problem:
I'm having the exact same problem, with Python 3.7. Already installed tcl-tk-devel via the cygwin setup. Note the import statement specifies that _tkagg must be in (for me) /usr/lib/python3.7/site-packages/matplotlib/backends . And it is there! File _tkagg.cpython-37m-x86_64-cygwin.dll . For some reason the import fails to load it. – Phil Goetz Apr 2 at 20:50
And I found this solution, which I had written down in my notes, copied from #5962
It would seem there is a known incompatibility between Matplotlib and Tk version 8.6, but the pip3 install doesn't check and warn about Tk 8.6 incompatibility and disable TkAgg if Tk 8.6 is present when attempting to build/install the TkAgg interface. At least nothing appeared on the command line during a pip3 install --home matplotlib install. It is possible if I threw the -v switch, there might have been some sort of warning generated.
So I reverted cygwin64 package tk-devel from Tk 8.6 to 8.5.11-1 .
(This reversion didn't work for cygwin 32-bit, BTW; it complained that it couldn't download package 'freeglut'.)
But I kept getting the same _tkagg error.
I tried re-installing matplotlib, and in poking around discovered that my cygwin pip3 is, apparently, installing packages in my Anaconda3 install of python3.7, not my cygwin install of python3.7. Then I remembered that that had been my solution: I had to run my program inside an Anaconda3 window, using Anaconda's python. So I did that, and my program worked. I still haven't been able to get it run with Cygwin's python3.7 .
Activity
WeatherGod commentedon Feb 3, 2016
How did you install/build matplotlib? Chances are, if you built it from
source, then you didn't have the gui headers available, so it fell back to
a default of the headless AGG backend.
On Tue, Feb 2, 2016 at 8:31 PM, Gavin S notifications@github.com wrote:
s7726 commentedon Feb 3, 2016
I installed using
pip install matplotlib. Is there a particular set of libraries or dev packages I should be looking for to install?Some kind of warning or something would be nice, when it's defaulting to a perceived inoperable mode.
tacaswell commentedon Feb 14, 2016
What does
give you? My guess is that it is going to say 'Agg', which is a non interactive backend. My guess is that you are missing a gui-toolkit wrapping library.
s7726 commentedon Mar 1, 2016
Qt5AggWhat should I have available for it to use something else?
It would be nice if there were some kind of prompt or message to indicate defaulting to a non-functional (from user perspective) behavior.
tacaswell commentedon Mar 2, 2016
Are you using plain python or ipython with
%matplotlibmagic.There are many use cases for mpl where an interactive backend is not desired so we can not guess when the lack of one is intentional or not.
Does pyqt5 import cleanly?
Try
AmeyaVS commentedon Mar 9, 2017
I am also facing similar issue under cygwin.
Initially when I installed matplotlib-2.0.0 in python-2.7 which is working fine.
But when I moved to python-3.4.5 suddenly the sample applications also stopped working.
After looking into dependencies and found out that the python3-tkinter backend was missing.
After installing all the dependencies and rebuilding I am getting this error:
After poking around my local installation for both python-2.7 and python-3.4.5 packages these are the differences I found in the libraries built:
Python-2.7:
$HOME/.local/lib/python2.7/site-packages/matplotlib/backends/_tkagg.dllPython-3.4.5:
$HOME/.local/lib/python3.4/site-packages/matplotlib/backends/_tkagg.cpython-34m.dllIt seems while importing the _tkagg package it looks for the _tkagg.dll
Is there a way I can suppress the "cpython-34m" in the generated library? or
Should I file a bug request at Cygwin for reporting this behaviour for the build?
Note: I am using pip3 for managing the python libraries.
Update: It was too pre-mature comment on my end, even after renaming the '_tkagg.cpython-34m.dll' to '_tkagg.dll' I am seeing the same error mentioned above.
KptainBiwouak commentedon Oct 11, 2017
I am facing exactly same kind of issue after trying to build Matplolib (v2.0.2 & v2.1.0).
Build is successfull but Import _tkagg fails
Could you provide us some guidelines in order to be able to use this module?
Which dependencies are exactly required?
Note: I am working from Cygwin 2.9.0 (x64) + Python 3.6.1
matthew-brett commentedon Oct 11, 2017
@KptainBiwouak - what do you get for:
in Python?
KptainBiwouak commentedon Oct 11, 2017
Using Python 3.6.1, I got no error.
It works.
I am using default python3-tkinter-3.6.1-1 module provided from Cygwin packages
lharcke commentedon Jun 27, 2018
Same RuntimeError here from an install on Cygwin 64-bit via
pip3 install --home matplotlibNow to test
tkinter:Here's the
matplotlibback end:So,
tkinterseems to be installed properly, and the "hello, world." example works. But interactive plotting withmatplotlibfails.Can also generate the error simply by issuing:
But then
https://matplotlib.org/users/installing.htmlsays:So maybe
matplotlibJust Doesn't Work with Tk version 8.6 (why not?)WeatherGod commentedon Jun 28, 2018
lharcke commentedon Jun 28, 2018
Python3. pip3, Tcl/Tk and Tkinter were installed via the Cygwin package manager. Matplotlib is not packaged for Cygwin, so I did:
pip3 install --home matplotlibIt would seem there is a known incompatibility between Matplotlib and Tk version 8.6, but the pip3 install doesn't check and warn about Tk 8.6 incompatibility and disable TkAgg if Tk 8.6 is present when attempting to build/install the TkAgg interface. At least nothing appeared on the command line during a
pip3 install --home matplotlibinstall. It is possible if I threw the-vswitch, there might have been some sort of warning generated.1 remaining item
lharcke commentedon Jun 28, 2018
Remotely possible, as I have an Anaconda 4.2 Windows installation with Tkinter in C:\Program Files\Anaconda3\. But that would be very weird. Usually programs running under Cygwin ignore everything outside of the C:\cygwin64\ root directory. The pseudo-UNIX environment doesn't really permit programs to look above the pseudo-UNIX filesystem root, unless they explicitly try to access the mount point /cygdrive/c/. But UNIX programs generally don't know about the /cygdrive/c/ mount point, unless they are written specifically as Cygwin utilities/applications.
Anyway, Matplotlib isn't packaged for Cygwin, and a pip3 install of Matplotlib doesn't work out of the box for some reason (most likely Tk 8.6 incompatibility), which isn't flagged/reported during the pip3 build/install.
lharcke commentedon Jun 28, 2018
So, here's the bit from
setupext.pywhere theTkAggbuild is prepared:From static inspection, on current Cygwin,
tkinterwill load whenruntime_check()is called. But it would appear that theadd_flags()method will fail to add a dynamic linker for Cygwin, as on Cygwin, the call tosys.platformreturnsand
cygwinis not in the if/elif check for dynamic linker flags.Glancing through the rest of the installer script, it appears there are many tests of
sys.platformforw32,darwin,linux,sunos5,aix5and such, but none forcygwin. Also, there doesn't appear to be a check for specific versions of Tcl/Tk anywhere in the code.My guess at the bugfix is someone would have to spend some time editing the
setupext.pyscript to addcygwinas a specific supported flavor of UNIX, and also to beef up the version number checking for Tcl/Tk, if indeed the Tk requirement is >= 8.3 but not 8.6 or 8.6.1 per the Matplotlib install webpage. I do not see the general mechanism where thematplotlibinstaller script checks/verifies version numbers of dependencies.Sonic-Amiga commentedon May 13, 2020
Hello! Just hit the same problem and using the git master branch figured out what's wrong. Apparently Windows doesn't provide for RTLD_LOCAL / RTLD_GLOBAL semantics , so Cygwin's dlsym() against /usr/lib/python3.6/lib-dynload/_tkinter.cpython-36m-x86_64-cygwin.dll fails to locate Tk_FindPhoto symbol, which is in fact declared in /usr/bin/libtk8.6.dll, despite all the dependencies are in place.
It looks like we'll have to use Windows-native mechanism for symbol lookup for Cygwin.
tacaswell commentedon May 13, 2020
@Sonic-Amiga Do you know what those mechanisms are and if so could you open a Pull Request with the changes?
I don't think we currently test cygwin, but I suspect it would be possible on either appveyor or azure?
Sonic-Amiga commentedon May 14, 2020
@tacaswell I've sucessfully verified that you can use native Windows API, the same as for "raw" Win32 platform. In src/_tkagg.cpp you have several #ifdef _WIN32. Those ones related to symbol loading should become #if defined(_WIN32) || defined(CYGWIN). And link against psapi library for cygwin platform. Yes, Cygwin apps are not advised to use WinAPI directly, but you're using it with care here. :) An alternate solution would be to implement POSIX behavior in cygwin1.dll; and i'm not sure how difficult it would be. At least there's no quick solution to that.
Bear in mind that GetForegroundWindow/SetForegroundWindow should stay _WIN32-only since Cygwin, being an "honest" POSIX, uses X Window API for graphics.
Cygwin fixes
Sonic-Amiga commentedon May 14, 2020
@tacaswell Please consider the PR. I've verified it with xkcd.py; it works.
Cygwin fixes
QuLogic commentedon May 15, 2020
Fixed by #17415 (I can't test though.)
philgoetz commentedon Jun 29, 2020
I wrote a Python program that worked under cygwin python3.7 from late April through the end of May. I ran it again today and got the exact same error described here.
I can't tell you what backend it's using because:
I didn't use Python for anything else since the last time I ran my program.
I did, however, run Cygwin's auto-update several times since then.
I definitely also ran Cygwin's auto-update sometime in May, before running my program successfully.
So some Cygwin update released in May or June is causing this error again.
I recall that, in April, I initially installed python 3.8, but uninstalled it because I couldn't get seaborn to work. I don't remember if it was the same _tkagg error.
tacaswell commentedon Jun 29, 2020
@philgoetz Try re-installing Matplotlib (you have have changed Tk under it?). If that fails can you try
pip install --upgrade --pre matplotlibto try out 3.3.0rc1 which has the changes that closed this issue.philgoetz commentedon Jun 29, 2020
I found this comment on stackoverflow by me, describing the earlier problem:
I'm having the exact same problem, with Python 3.7. Already installed tcl-tk-devel via the cygwin setup. Note the import statement specifies that _tkagg must be in (for me) /usr/lib/python3.7/site-packages/matplotlib/backends . And it is there! File _tkagg.cpython-37m-x86_64-cygwin.dll . For some reason the import fails to load it. – Phil Goetz Apr 2 at 20:50And I found this solution, which I had written down in my notes, copied from #5962
It would seem there is a known incompatibility between Matplotlib and Tk version 8.6, but the pip3 install doesn't check and warn about Tk 8.6 incompatibility and disable TkAgg if Tk 8.6 is present when attempting to build/install the TkAgg interface. At least nothing appeared on the command line during a pip3 install --home matplotlib install. It is possible if I threw the -v switch, there might have been some sort of warning generated.So I reverted cygwin64 package tk-devel from Tk 8.6 to 8.5.11-1 .
(This reversion didn't work for cygwin 32-bit, BTW; it complained that it couldn't download package 'freeglut'.)
But I kept getting the same _tkagg error.
I tried re-installing matplotlib, and in poking around discovered that my cygwin pip3 is, apparently, installing packages in my Anaconda3 install of python3.7, not my cygwin install of python3.7. Then I remembered that that had been my solution: I had to run my program inside an Anaconda3 window, using Anaconda's python. So I did that, and my program worked. I still haven't been able to get it run with Cygwin's python3.7 .