Skip to content
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

Closed
jiffyclub opened this issue Oct 29, 2015 · 63 comments
Closed

Matplotlib 1.4.3 broken on Windows #1753

jiffyclub opened this issue Oct 29, 2015 · 63 comments
Labels
locked [bot] locked due to inactivity

Comments

@jiffyclub
Copy link

On Windows I have installed the latest matplotlib, which is version 1.4.3 build np110py27_2. When I try to import matplotlib.colorbar I get the error ImportError: 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.

@msarahan
Copy link
Contributor

Please install the libpng package. This should fix your issue. That should be a runtime dependency, but the recipe needs fixing.

@jiffyclub
Copy link
Author

When I try conda install libpng it reports that it is already installed.

@msarahan
Copy link
Contributor

OK, we will try to reproduce here.

@fdeheeger
Copy link

Same issue here. The problem affects the png backend in the notebook. So %matplotlib inline leads to the same import error.
To reproduce it, i run:
conda create -n mess matplotlib python=2.7 ipython=3.2 pyzmq (ipython and pyzmq just to be able to access the env from the already running notebook server)

I reinstall matplotlib using pip in that env to solve the issue. (which does not help to understand !)

@marscher
Copy link

marscher commented Nov 3, 2015

confirmed. Do you already have a clue, what is causing this?

@marscher
Copy link

marscher commented Nov 3, 2015

Installing the meta-package anaconda solved the problem, but it also dragged in alot of new dependencies.

@dacoex
Copy link

dacoex commented Nov 3, 2015

I can confirm this issue.

@ryandkerr
Copy link

I am having the same issue, except running conda install anaconda did not solve the issue for me.

@msarahan
Copy link
Contributor

msarahan commented Nov 4, 2015

@fdeheeger I tried your conda create command (Thanks - this is very helpful for reproduction purposes):

C:\>conda create -n mess matplotlib python=2.7 ipython=3.2 pyzmq
Fetching package metadata: ......
Solving package specifications: ....................
Package plan for installation in environment C:\Users\builder\MC_Main\envs\mess:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    msvc_runtime-1.0.1         |            vc9_0         1.1 MB
    pyreadline-2.1             |           py27_0         127 KB
    ipython-3.2.1              |           py27_0         3.4 MB
    pyqt-4.11.4                |           py27_2         3.9 MB
    matplotlib-1.4.3           |      np110py27_3        40.8 MB
    ------------------------------------------------------------
                                           Total:        49.4 MB

The following NEW packages will be INSTALLED:

    ipython:         3.2.1-py27_0
    jpeg:            8d-vc9_0          [vc9]
    libpng:          1.6.17-vc9_1      [vc9]
    libtiff:         4.0.6-vc9_0       [vc9]
    matplotlib:      1.4.3-np110py27_3
    msvc_runtime:    1.0.1-vc9_0       [vc9]
    numpy:           1.10.1-py27_0
    openssl:         1.0.2d-vc9_0      [vc9]
    pip:             7.1.2-py27_0
    pyparsing:       2.0.3-py27_0
    pyqt:            4.11.4-py27_2
    pyreadline:      2.1-py27_0
    python:          2.7.10-3
    python-dateutil: 2.4.2-py27_0
    pytz:            2015.6-py27_0
    pyzmq:           14.7.0-py27_1
    qt:              4.8.7-vc9_4       [vc9]
    setuptools:      18.4-py27_0
    sip:             4.16.9-py27_1
    six:             1.10.0-py27_0
    tk:              8.5.18-vc9_0      [vc9]
    wheel:           0.26.0-py27_1
    zlib:            1.2.8-vc9_2       [vc9]

Proceed ([y]/n)?

Fetching packages ...
msvc_runtime-1 100% |###############################| Time: 0:00:06 196.15 kB/s
pyreadline-2.1 100% |###############################| Time: 0:00:00 163.12 kB/s
ipython-3.2.1- 100% |###############################| Time: 0:00:16 216.73 kB/s
pyqt-4.11.4-py 100% |###############################| Time: 0:00:14 286.13 kB/s
matplotlib-1.4 100% |###############################| Time: 0:03:03 232.81 kB/s
Extracting packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
        1 file(s) copied.#########################################       |  86%
[      COMPLETE      ]|##################################################| 100%
#
# To activate this environment, use:
# > activate mess
#

C:\>activate mess
Activating environment "C:\Users\builder\MC_Main\envs\mess"...

[mess] C:\>ipython
Python 2.7.10 |Continuum Analytics, Inc.| (default, Oct 21 2015, 19:35:23) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 3.2.1 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import matplotlib.pyplot as plt

In [2]: matplotlib
Using matplotlib backend: Qt4Agg

In [3]: import numpy as np

In [4]: plt.plot(np.random.random(100))
Out[4]: [<matplotlib.lines.Line2D at 0x91febe0>]

In [5]:

Things work OK for me. Have you done

conda update conda
conda update --all

@msarahan
Copy link
Contributor

msarahan commented Nov 4, 2015

@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.

@fdeheeger
Copy link

I was not clear enough, sorry.
That is the funny thing. It works in ipython console but not in the
notebook.
It is a png backend issue...
Le 3 nov. 2015 7:39 PM, "Mike Sarahan" notifications@github.com a écrit :

@fdeheeger https://github.com/fdeheeger I tried your conda create
command (Thanks - this is very helpful for reproduction purposes):

C:>conda create -n mess matplotlib python=2.7 ipython=3.2 pyzmq
Fetching package metadata: ......
Solving package specifications: ....................
Package plan for installation in environment C:\Users\builder\MC_Main\envs\mess:

The following packages will be downloaded:

package build
msvc_runtime-1.0.1 vc9_0 1.1 MB
pyreadline-2.1 py27_0 127 KB
ipython-3.2.1 py27_0 3.4 MB
pyqt-4.11.4 py27_2 3.9 MB
matplotlib-1.4.3 np110py27_3 40.8 MB
------------------------------------------------------------
                                       Total:        49.4 MB

The following NEW packages will be INSTALLED:

ipython:         3.2.1-py27_0
jpeg:            8d-vc9_0          [vc9]
libpng:          1.6.17-vc9_1      [vc9]
libtiff:         4.0.6-vc9_0       [vc9]
matplotlib:      1.4.3-np110py27_3
msvc_runtime:    1.0.1-vc9_0       [vc9]
numpy:           1.10.1-py27_0
openssl:         1.0.2d-vc9_0      [vc9]
pip:             7.1.2-py27_0
pyparsing:       2.0.3-py27_0
pyqt:            4.11.4-py27_2
pyreadline:      2.1-py27_0
python:          2.7.10-3
python-dateutil: 2.4.2-py27_0
pytz:            2015.6-py27_0
pyzmq:           14.7.0-py27_1
qt:              4.8.7-vc9_4       [vc9]
setuptools:      18.4-py27_0
sip:             4.16.9-py27_1
six:             1.10.0-py27_0
tk:              8.5.18-vc9_0      [vc9]
wheel:           0.26.0-py27_1
zlib:            1.2.8-vc9_2       [vc9]

Proceed ([y]/n)?

Fetching packages ...
msvc_runtime-1 100% |###############################| Time: 0:00:06 196.15 kB/s
pyreadline-2.1 100% |###############################| Time: 0:00:00 163.12 kB/s
ipython-3.2.1- 100% |###############################| Time: 0:00:16 216.73 kB/s
pyqt-4.11.4-py 100% |###############################| Time: 0:00:14 286.13 kB/s
matplotlib-1.4 100% |###############################| Time: 0:03:03 232.81 kB/s
Extracting packages ...
[ COMPLETE ]|##################################################| 100%
Linking packages ...
1 file(s) copied.######################################### | 86%
[ COMPLETE ]|##################################################| 100%

To activate this environment, use:

> activate mess

C:>activate mess
Activating environment "C:\Users\builder\MC_Main\envs\mess"...

[mess] C:>ipython
Python 2.7.10 |Continuum Analytics, Inc.| (default, Oct 21 2015, 19:35:23) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 3.2.1 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]: import matplotlib.pyplot as plt

In [2]: matplotlib
Using matplotlib backend: Qt4Agg

In [3]: import numpy as np

In [4]: plt.plot(np.random.random(100))
Out[4]: [<matplotlib.lines.Line2D at 0x91febe0>]

In [5]:

Things work OK for me. Have you done

conda update conda
conda update --all


Reply to this email directly or view it on GitHub
#1753 (comment).

@jiffyclub
Copy link
Author

@msarahan I no longer have a Windows computer on which to reproduce this, but I was only getting the error when I tried import matplotlib.colorbar. Importing pyplot actually would not trigger the error.

@msarahan
Copy link
Contributor

msarahan commented Nov 4, 2015

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 conda list here:

[mess] C:\>conda list
# packages in environment at C:\Users\builder\MC_Main\envs\mess:
#
backports.ssl-match-hostname 3.4.0.2                   <pip>
ipython                   3.2.1                    py27_0
jinja2                    2.8                      py27_0
jpeg                      8d                        vc9_0  [vc9]
jsonschema                2.4.0                    py27_0
libpng                    1.6.17                    vc9_1  [vc9]
libtiff                   4.0.6                     vc9_0  [vc9]
markupsafe                0.23                     py27_0
matplotlib                1.4.3               np110py27_3
msvc_runtime              1.0.1                     vc9_0  [vc9]
numpy                     1.10.1                   py27_0
openssl                   1.0.2d                    vc9_0  [vc9]
pip                       7.1.2                    py27_0
pyparsing                 2.0.3                    py27_0
pyqt                      4.11.4                   py27_2
pyreadline                2.1                      py27_0
python                    2.7.10                        3
python-dateutil           2.4.2                    py27_0
pytz                      2015.6                   py27_0
pyzmq                     14.7.0                   py27_1
qt                        4.8.7                     vc9_4  [vc9]
setuptools                18.4                     py27_0
sip                       4.16.9                   py27_1
six                       1.10.0                   py27_0
ssl_match_hostname        3.4.0.2                  py27_0
tk                        8.5.18                    vc9_0  [vc9]
tornado                   4.2.1                    py27_1
wheel                     0.26.0                   py27_1
zlib                      1.2.8                     vc9_2  [vc9]

[mess] C:\>

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:
(lots of stuff elided);C:\Users\builder\MC_Main;C:\Users\builder\MC_Main\Scripts;C:\Users\builder\MC_Main\Library\bin;

Please also specify whether this is a user-level install, or a system-wide install that you're having issues with. Did you conda update conda prior to updating the rest of your system? What happens if you try that now, followed by conda update --all?

@fdeheeger
Copy link

I do not need more dependencies as the notebook server is from running from
another env... The "mess" env (poor name) is just a kernel env. (Could it
be a reason ?).

I'll check the conda update thing and post the dependencies.
Thanks for your advices.
Le 3 nov. 2015 8:46 PM, "Mike Sarahan" notifications@github.com a écrit :

Lots of dependencies missing for IPython notebook in @fdeheeger
https://github.com/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 conda list here:

[mess] C:>conda list

packages in environment at C:\Users\builder\MC_Main\envs\mess:

backports.ssl-match-hostname 3.4.0.2
ipython 3.2.1 py27_0
jinja2 2.8 py27_0
jpeg 8d vc9_0 [vc9]
jsonschema 2.4.0 py27_0
libpng 1.6.17 vc9_1 [vc9]
libtiff 4.0.6 vc9_0 [vc9]
markupsafe 0.23 py27_0
matplotlib 1.4.3 np110py27_3
msvc_runtime 1.0.1 vc9_0 [vc9]
numpy 1.10.1 py27_0
openssl 1.0.2d vc9_0 [vc9]
pip 7.1.2 py27_0
pyparsing 2.0.3 py27_0
pyqt 4.11.4 py27_2
pyreadline 2.1 py27_0
python 2.7.10 3
python-dateutil 2.4.2 py27_0
pytz 2015.6 py27_0
pyzmq 14.7.0 py27_1
qt 4.8.7 vc9_4 [vc9]
setuptools 18.4 py27_0
sip 4.16.9 py27_1
six 1.10.0 py27_0
ssl_match_hostname 3.4.0.2 py27_0
tk 8.5.18 vc9_0 [vc9]
tornado 4.2.1 py27_1
wheel 0.26.0 py27_1
zlib 1.2.8 vc9_2 [vc9]

[mess] C:>

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:
(lots of stuff
elided);C:\Users\builder\MC_Main;C:\Users\builder\MC_Main\Scripts;C:\Users\builder\MC_Main\Library\bin;

Please also specify whether this is a user-level install, or a system-wide
install that you're having issues with. Did you conda update conda prior
to updating the rest of your system? What happens if you try that now,
followed by conda update --all?


Reply to this email directly or view it on GitHub
#1753 (comment).

@msarahan
Copy link
Contributor

msarahan commented Nov 4, 2015

the notebook server is running from another env

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.

@cwcobb
Copy link

cwcobb commented Nov 4, 2015

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.

C:\Anaconda\lib\site-packages\matplotlib\mathtext.py in <module>()
61 
62 import matplotlib.colors as mcolors
---> 63 import matplotlib._png as _png
64 ####################
65 
ImportError: DLL load failed: The specified module could not be found.

@cwcobb
Copy link

cwcobb commented Nov 4, 2015

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).

@dacoex
Copy link

dacoex commented Nov 4, 2015

There seem to be some dependancy probelms:

C:\Users\USER\AppData\Local\Continuum\Anaconda>conda update --all
Fetching package metadata: ....
Solving package specifications: .....................................................................
........................................................................................
Package plan for installation in environment C:\Users\USER\AppData\Local\Continuum\Anaconda:

The following packages will be DOWNGRADED:

    numpy:  1.10.1-py27_0      --> 1.9.3-py27_0
    pandas: 0.17.0-np110py27_0 --> 0.16.2-np19py27_0

Proceed ([y]/n)?

@marscher
Copy link

marscher commented Nov 4, 2015

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.

@Franck-Dernoncourt
Copy link

I had the same issue (http://stackoverflow.com/q/33459574/395857), conda install anaconda "solved" it. (Anaconda Python 2.7 x64 with Windows 7 SP1 x64 Ultimate)

@marscher
Copy link

marscher commented Nov 5, 2015

This env works (I do not know why).

- conda=3.18.3=py27_0
- conda-build=1.18.1=py27_0
- conda-env=2.4.4=py27_0


- jinja2=2.8=py27_0

- jpeg=8d=vc9_0
- libpng=1.6.17=vc9_1
- libtiff=4.0.6=vc9_0
- markupsafe=0.23=py27_0
- matplotlib=1.4.3=np110py27_3

- menuinst=1.2.1=py27_0
- mock=1.3.0=py27_0

- msvc_runtime=1.0.1=vc9_0
- numpy=1.10.1=py27_0
- openssl=1.0.2d=vc9_0

- patch=2.5.9=1
- pbr=1.3.0=py27_0
- pip=7.1.2=py27_0
- psutil=3.2.2=py27_0
- pycosat=0.6.1=py27_0
- pycrypto=2.6.1=py27_3
- pyparsing=2.0.3=py27_0
- pyqt=4.11.4=py27_2
- python=2.7.10=3

- pytz=2015.6=py27_0
- pyyaml=3.11=py27_2
- qt=4.8.7=vc9_4
- requests=2.8.1=py27_0
- scipy=0.16.0=np110py27_0
- scripttest=1.3=py27_0
- setuptools=18.4=py27_0
- sip=4.16.9=py27_1
- six=1.10.0=py27_0
- tk=8.5.18=vc9_0
- wheel=0.26.0=py27_1
- zlib=1.2.8=vc9_2

@msarahan
Copy link
Contributor

msarahan commented Nov 6, 2015

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:

"Ensuring that C:\Users\builder\Miniconda\Library\bin is on user PATH environment variable."

SUCCESS: Specified value was saved.
Please open a new console window to make sure that the new PATH is in effect.

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.

@msarahan msarahan closed this as completed Nov 6, 2015
@msarahan
Copy link
Contributor

msarahan commented Nov 6, 2015

@dacoex

There seem to be some dependancy probelms

This is a separate, very important issue. Please file a separate issue for it.

@RoyalTS
Copy link

RoyalTS commented Nov 6, 2015

@msarahan What should those of us with this issue do to get the new conda-env?

@msarahan
Copy link
Contributor

msarahan commented Nov 6, 2015

conda update conda-env should do the trick.

@marscher
Copy link

marscher commented Nov 9, 2015

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?

@msarahan
Copy link
Contributor

msarahan commented Nov 9, 2015

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:

  1. does Lib/site.py have a section like:
if sys.prefix == sitedir:
    os.environ["PATH"]=os.pathsep.join([os.environ["PATH"], dir)
  1. Is library_bin.pth present in your prefix?

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.

@marscher
Copy link

marscher commented Nov 9, 2015

os.path.environ is temporary to the current Python process (at least on some systems...)

@msarahan
Copy link
Contributor

msarahan commented Nov 9, 2015

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
(Library/bin gets appended at https://github.com/conda/conda-build/blob/109f235c86f129b629af41b193715904c7c4205a/conda_build/environ.py#L109)

This has changed in master slightly (still functionally equivalent, AFAICT):
https://github.com/conda/conda-build/blob/master/conda_build/build.py#L545-L560

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?

@msarahan msarahan reopened this Nov 9, 2015
@marscher
Copy link

marscher commented Nov 9, 2015

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.

@msarahan
Copy link
Contributor

msarahan commented Nov 9, 2015

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.

@pelson
Copy link
Contributor

pelson commented Nov 9, 2015

@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:

The following packages will be UPDATED:

    conda-env:       2.4.4-py35_0 defaults --> 2.4.4-py35_1  defaults   
    msvc_runtime:    1.0.0-vc14_0 defaults [vc14] --> 1.0.1-vc14_0  defaults    [vc14]

not was unexpected at this time.
Error: Error: post-link failed for: conda-env-2.4.4-py35_1

Is there anything we can do to help?

@msarahan
Copy link
Contributor

msarahan commented Nov 9, 2015

@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.

@ghost
Copy link

ghost commented Nov 9, 2015

Perhaps this should be added to the "Known Issues" section for Anaconda 2.4's changelog.

@ukoethe
Copy link
Contributor

ukoethe commented Nov 9, 2015

in response to @msarahan

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'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.

@ukoethe
Copy link
Contributor

ukoethe commented Nov 9, 2015

Several posts in this thread mention the Python error message

ImportError: DLL load failed: The specified module could not be found.

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.

@Twizzledrizzle
Copy link

I have problems as well, but not through IPython, only through the Juniper notebook. I have tried the various conda commands listed above but with little success!

I get the dll not found error, so I used dependency walker, and here is how it looks
capture

Could the kernel32 be the problem? I have windows7 64 bit
capture

This is the errors I get in dependency walker

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

@Twizzledrizzle
Copy link

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.

@ccordoba12
Copy link

@Twizzledrizzle, what code are you running on the notebook?

@Twizzledrizzle
Copy link

I was running import matplotlib.pyplot

I found it... Hah! I had a .bat file opening the notebook for me, stating ipython notebook something.

The new way apparantly is the little longer C:\Anaconda2\python.exe C:\Anaconda2\cwp.py C:\Anaconda2 "C:/Anaconda2/python.exe" "C:/Anaconda2/Scripts/ipython-script.py" notebook

I am happy now :)

@dacoex
Copy link

dacoex commented Nov 24, 2015

after updating conda, anaconda & matplotlib this issue is solved at my end.

@ccordoba12
Copy link

Great!

@asteppke
Copy link

@ukoethe @Twizzledrizzle
Comparing your output to the contents of the bin directory lead me to a way to figure out which DLL cannot be found. It is the libpng16.dll that matplotlib wants to load. Everything works fine if e.g. the PATH includes this DLL, otherwise we get the error message.

Here as a workaround adding the directory to PATH as suggested above works fine.

@ukoethe
Copy link
Contributor

ukoethe commented Nov 25, 2015

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)

@par2
Copy link

par2 commented Dec 20, 2015

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 matplotlib group.

I am referencing a similar issue in a previous matplotlib verison.

@msarahan
Copy link
Contributor

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?

@github-actions
Copy link

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.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Nov 27, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests