-
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
Matplotlib 1.4.3 broken on Windows #1753
Comments
Please install the libpng package. This should fix your issue. That should be a runtime dependency, but the recipe needs fixing. |
When I try |
OK, we will try to reproduce here. |
Same issue here. The problem affects the png backend in the notebook. So I reinstall matplotlib using pip in that env to solve the issue. (which does not help to understand !) |
confirmed. Do you already have a clue, what is causing this? |
Installing the meta-package anaconda solved the problem, but it also dragged in alot of new dependencies. |
I can confirm this issue. |
I am having the same issue, except running |
@fdeheeger I tried your conda create command (Thanks - this is very helpful for reproduction purposes):
Things work OK for me. Have you done
|
@ryandkerr which version of anaconda did it try to pull in? Are you using a user-level installation, or a system-wide one? Some of these issues may be related to ContinuumIO/anaconda-issues#509 Try adding (your prefix)\Library\bin to PATH, if it isn't already there. The Qt dlls live there. As mentioned in issue 509, we are working on a patch that will fix this for you, but changing PATH yourself may be the fastest thing right now. |
I was not clear enough, sorry.
|
@msarahan I no longer have a Windows computer on which to reproduce this, but I was only getting the error when I tried |
Lots of dependencies missing for IPython notebook in @fdeheeger 's mess environment: tornado, jinja2, jsonschema For what little it's worth, though, once the notebook dependencies were installed, things work fine for me. I tried both the Qt4Agg backend being driven by the IPython notebook, and the inline backend. I tried image plots with colorbars, in addition to the line plot code above. Everything just works. I'm posting my
If any of you who are having problems can cross-check and report discrepancies, I'd be very appreciative. Also, my test machine's PATH: Please also specify whether this is a user-level install, or a system-wide install that you're having issues with. Did you |
I do not need more dependencies as the notebook server is from running from I'll check the conda update thing and post the dependencies.
|
I'm not familiar with this configuration. If your other env has requirements inconsistent with this one, and particularly if there are different DLLs getting picked up due to the notebook server env's PATH coming before the kernel env's PATH, then all bets are off. You either need to make sure that the DLLs in each environment are consistent (this is hard, and probably not even desirable), or make absolutely certain that you "activate" the kernel environment before starting up the kernel, so that its PATH is prepended right up front, not floating around in some unknown position. It is insufficient to just call "ipython" to start a kernel; that does not put Library/bin on PATH! New Windows shortcuts for the notebook should do this PATH manipulation for you. Old ones do not. You can tell the difference because new ones have the env name in parentheses after them. New ones also reflect Jupyter project naming, but this is for IPython >=4, not the package used here. For packages without shortcuts, you need to do this activation in a cmd.exe prompt. Powershell support is still lacking - unless you know you have it set up correctly. For the curious: this is likely arising because Matplotlib used to be statically linked to libpng, among other things, on Windows only. In the interest of removing special cases, I made the Windows build consistent with the Linux/Mac builds, and use shared libraries. I ensure that these shared libraries exist in %PREFIX%\Library\bin, and I try really hard to make sure that that folder is on PATH. If that folder is not on PATH, for whatever environment you're trying to run, or if any other folder with similarly-named, but other-versioned files in it is before the correct PATH, then yes, I would fully expect the errors reported here. |
I can confirm the failure on a system-wide Windows 10 64bit Anaconda install using Python 2.7.10. Comparing to msarahan's package list, I am running IPython 4 (actually Jupyter notebook 4.0.6 with matching core), but otherwise I match identically. I receive the error detailed below when trying to import pyplot or run the %matplotlib inline magic. I can resolve the issue by reverting back using 'conda install matplotlib=1.4.3=np110py27_1'. For the time being, this seems to be a reasonably quick and easy solution on my end.
|
As a cursory test, I ran 'pip install --upgrade matplotlib' on my test rig to pull down mpl 1.5, which now appears to work with no issue. I know it's bad practice to use pip on conda managed packages, but perhaps this data point is useful (and more likely, not). |
There seem to be some dependancy probelms:
|
On Appveyor it also fails, if "anaconda" meta-package is being installed. https://ci.appveyor.com/project/marscher/pyemma-668/build/1.0.398/job/bsgbasgi3ohw4m8j So first all dependencies of the software + "anaconda" are installed then import matplotlib fails with the png error again. |
I had the same issue (http://stackoverflow.com/q/33459574/395857), |
This env works (I do not know why).
|
This fix has been released as conda-env-2.4.4-1. It has been tested to work with both user-level, and system-level installations of Miniconda version 3.16 and Anaconda 2.3. Updating from earlier versions should behave similarly. You will see a message like:
when the script runs. You can view the script in (your prefix)\Scripts.conda-env-post-link.bat I'm closing this issue, but feel free to reopen this if the issue remains. |
This is a separate, very important issue. Please file a separate issue for it. |
@msarahan What should those of us with this issue do to get the new conda-env? |
|
On Python-3.4 win64 conda-env-2.4.4_2 is still affected and seems to be the latest version. @msarahan can you trigger another build for py34 please? |
Thanks for the link to your appveyor - that is very helpful. I'm afraid I'm going to have to clone your repo and try to reproduce/fix this tomorrow. What I need to check is:
It looks from your build log that the correct build of Python 3.4.3-4 is getting installed. I have extracted the tarball on the distribution server to double-check it. It looks fine (conditions 1 and 2 are ok). I'm really lost on this. What needs to be there is that os.environ["PATH"] needs to have PREFIX/Library/bin in it. Something is going wrong with site.py. My only real thought is that there's something complicated about subprocesses, and the python running your tests may not be the newest one? Should not be possible, I know, but everything else seems to be in order. |
os.path.environ is temporary to the current Python process (at least on some systems...) |
Yes, that's what I would expect, but I would also expect any Python subprocess to also pick up the site.py stuff when starting up. What's even weirder is that conda-build has injected Library/bin for quite a while - longer than this recent development with site.py. Here is 3.18.1: https://github.com/conda/conda-build/blob/109f235c86f129b629af41b193715904c7c4205a/conda_build/build.py#L548-L563 This has changed in master slightly (still functionally equivalent, AFAICT): I will attempt to clone and work this out tomorrow. Failing all else, is it possible to set PATH on AppVeyor (see https://github.com/voodootikigod/node-serialport/blob/master/appveyor.yml#L29)? I'd like to fix this without resorting to that, certainly, but I only have so much time. If setting PATH is a workaround for now, would you consider it? |
I already tried setting the path manually (set and setx), but the previous build of conda-env complained that this path is still missing. Did this behaviour just changed in the new build? I would consider it then, until we have something more sustainable around. |
Sorry, I took a closer look. The 32-bit Python-3.4.3-4 package indeed did not have the site.py and library_bin.pth files in it, somehow. I must have been looking at the 64-bit one before. Now, we have the unsatisfiable dependencies issue: https://ci.appveyor.com/project/msarahan/pyemma Sorry, I hope we can get that unsatisfiable mess sorted tomorrow. |
@msarahan - just wanted to let you know we are seeing similar problems in https://ci.appveyor.com/project/pelson/conda-recipes-scitools-311/build/1.0.319/job/jhu6uj1pjavbng7o which are related to the issue reported:
Is there anything we can do to help? |
@pelson thanks hugely for your offer of help. At this point, I am leaning towards ditching the whole feature concept for tracking compilers, and rather going back and doing it differently (hopefully right): track compiler used like numpy and python themselves are tracked. This was originally suggested/requested by @ukoethe in #1779 (comment) I don't know exactly how to do this in the most cross-platform way possible, but it certainly should not break Linux & Mac (of course). One bonus feature to this would be to take it one step further, and match not only compiler, but also things like architecture optimized for. For the latter, exact matches would not make sense. An exact match would be optimal, but a less highly optimized match should also get found when an exact match is not available. For example, let's say there's numpy with gcc5.1 and march=i686, and scipy also with gcc5.1, but with march=nehalem (numpy dependency less specifically optimized than scipy). Installing scipy should not fail with numpy as a dependency. GCC versions should be compatible for C APIs, but we're seeing strange crashes and numerical issues with SciPy, using the CentOS 5 GCC version. Forcing GCC versions to match would potentially require a lot more compilation than we do now, but I think that price is worth paying for the ability to modernize more readily. With the compiler used, one complicating factor is compatibility: the Intel compilers can be set to behave like MSVC at a particular version. What does the compiler ID show up as when an Intel compiler is used? How interchangeable are its produced binaries with the MSVC version that it is behaving like? What are its runtime binary requirements? If it needs Intel's runtime (probably), then I would argue that the Intel compiler ID needs to be intel compiler (with version) plus msvc version being "emulated" - probably not the right word, but I'm sticking with it. If you have ideas on a quick PR for the compiler (exact matches allowed/preferred, I think), I would hugely appreciate it. If I do it myself, I have some learning to do, but I think you are more familiar with Conda's internals and could fix this faster than me. Bonus for the optimization stuff - but I think that's separate. I think that's probably some hacking with MatchSpec's, in addition to encoding this optimization info somewhere. The Intel compiler concern is a lesser one - I think that's a bit of a corner case, with not huge market share presently. However, if the design now blocks that kind of thing later, it would be bad. |
Perhaps this should be added to the "Known Issues" section for Anaconda 2.4's changelog. |
in response to @msarahan
I'm not suggesting to ditch the feature concept. To the contrary, I'd love to use it as the primary mechanism for ensuring compatible installations once the issues with feature-related version resolution (see #1589 and references therein) are resolved. My proposal to use jinja2 configuration is entirely orthogonal. It could be used to automatically define the appropriate features of a package. In addition, I use jinja2 to configure version suffixes, but these are mainly needed to work around the feature resolution problems mentioned above. |
Several posts in this thread mention the Python error message
Unfortunately, Python does not tell us exactly which DLL causes the problem, and it is usually not the module to be imported, but one of its dependencies. In case of png, the missing DLL could be zlib, or the linker attempts to load the wrong version of an existing DLL because two versions happen to be in the PATH, and the wrong one gets preference. If you see the above error message, always use Dependency Walker to find out which DLL is actually causing problems. When invoking Dependency Walker, make sure that the current PATH settings exactly correspond to the ones during the failed import. |
Removing anaconda completely, and reinstalling anaconda 2.4 does not fix the problem importing matplotlib.pyplot either. I only get this error when working in Jupyter, not Ipython or Spyder. |
@Twizzledrizzle, what code are you running on the notebook? |
I was running import matplotlib.pyplot I found it... Hah! I had a .bat file opening the notebook for me, stating The new way apparantly is the little longer I am happy now :) |
after updating conda, anaconda & matplotlib this issue is solved at my end. |
Great! |
@ukoethe @Twizzledrizzle Here as a workaround adding the directory to PATH as suggested above works fine. |
This is a dangerous fix. If the ´libpng16.dll´ that was found elsewhere in the PATH (i.e. outside the conda environment) was compiled with a different compiler version than matplotlib or its conda-provided dependencies, the programm will likely crash upon first use of libpng. Apparently, libpng is missing in the run requirements of some conda recipe. This must be fixed by the recipe owner (probably Continuum) |
I am missing this dependency and another on both Windows and Linux machines for python 2.7 and 3.5 I suspect these issues are recurring and lie with the I am referencing a similar issue in a previous matplotlib verison. |
Closing this issue. These issues should all be well-fixed with the Anaconda 2.4.1 release. The modifications made were to modify Lib/site.py in each Python version to add Library/bin to os.environ["PATH"]. Please report new issues separately. @par2 these issues were only on Windows to begin with. If you are still having issues, then something else is wrong. Do you have PYTHONPATH set? Some other installation of Matplotlib might be getting picked up. What is the value of your PATH environment variable? What version of Matplotlib are you trying to run? Better yet, what is the output of conda list Finally, could you please open a new issue for this? |
Hi there, thank you for your contribution to Conda! This issue has been automatically locked since it has not had recent activity after it was closed. Please open a new issue if needed. |
On Windows I have installed the latest matplotlib, which is version
1.4.3
buildnp110py27_2
. When I try toimport matplotlib.colorbar
I get the errorImportError: DLL load failed: The specified module could not be found.
on line 63 of matplotlib/mathtext.py:import matplotlib._png as _png
. This happens with both 32 and 64 bit miniconda.I tried downgrading to matplotlib 1.4.1
import matplotlib.colorbar
works fine then.The text was updated successfully, but these errors were encountered: