conda / conda

A system-level, binary package and environment manager running on all major operating systems and platforms.
https://docs.conda.io/projects/conda/
Other
6.38k stars 1.66k forks source link

Matplotlib 1.4.3 broken on Windows #1753

Closed jiffyclub closed 8 years ago

jiffyclub commented 8 years ago

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 commented 8 years ago

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

jiffyclub commented 8 years ago

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

msarahan commented 8 years ago

OK, we will try to reproduce here.

fdeheeger commented 8 years ago

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 commented 8 years ago

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

marscher commented 8 years ago

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

dacoex commented 8 years ago

I can confirm this issue.

ryandkerr commented 8 years ago

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

msarahan commented 8 years ago

@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 commented 8 years ago

@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 https://github.com/ContinuumIO/anaconda-issues/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 commented 8 years ago

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 https://github.com/conda/conda/issues/1753#issuecomment-153534613.

jiffyclub commented 8 years ago

@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 commented 8 years ago

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 commented 8 years ago

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 https://github.com/conda/conda/issues/1753#issuecomment-153544848.

msarahan commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

@dacoex

There seem to be some dependancy probelms

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

RoyalTS commented 8 years ago

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

msarahan commented 8 years ago

conda update conda-env should do the trick.

msarahan commented 8 years ago

Note that if you have a system-level install, it will ask for elevation to set your system PATH. If you don't give it permission, it won't work.

dacoex commented 8 years ago

https://github.com/conda/conda/issues/1753#issuecomment-154405121 Does not solve it.

msarahan commented 8 years ago

@dacoex, could you please provide more information? Did it succeed in modifying your PATH? Did it show any errors or output? Please tell us more about your system.

marscher commented 8 years ago

Is there really the need to manually set this path? Can't it be injected in conda-env somehow?

msarahan commented 8 years ago

This is exactly what happens when you run the activate script. The problem is that with the root environment, you are never running the activate script.

marscher commented 8 years ago

I see. So why didn't we experience this problem before?

marscher commented 8 years ago

Can't you just patch the site.py file of the root env to include this path in os.env?

marscher commented 8 years ago

I do not think this expected? The path is already there, but conda-env still complains that it is not set. Used the latest installer (11/5/15)

D:\pyemma>setx PATH "%PATH%;C:\Users\marscher\Miniconda2\Library\bin"

SUCCESS: Specified value was saved.

D:\pyemma>conda install matplotlib
Fetching package metadata: ......
Solving package specifications: .....................
Package plan for installation in environment C:\Users\marscher\Miniconda2:

The following NEW packages will be INSTALLED:

    conda-env: 2.4.4-py27_1
    pytz:      2015.7-py27_0

Proceed ([y]/n)? y

Linking packages ...
"Ensuring that C:\Users\marscher\Miniconda2\Library\bin is on user PATH environm
ent variable."
"" was unexpected at this time.
Error: Error: post-link failed for: conda-env-2.4.4-py27_1

D:\pyemma>PATH
PATH=C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windo
ws\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\te
xlive2012\bin\win32;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Micr
osoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microso
ft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Bi
nn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (
x86)\Citrix\system32\;C:\Users\marscher\Miniconda2;C:\Users\marscher\Miniconda2\
Scripts;C:\Users\marscher\Miniconda2\Library\bin;C:\Users\marscher\software\ming
w\mingw64\bin;C:\Users\marscher\software\Git\cmd;C:\users\marscher\software\TDM-
GCC-64\bin;C:\Users\marscher\Miniconda2\Library\bin
msarahan commented 8 years ago

site.py is the right way to do this. I was not aware of it. I will set that up, and issue a new build of conda-env without this post-install script.

Thanks @marscher for pointing this out.

himadri111 commented 8 years ago

On installing chaco through conda, I have encountered a similar problem with conda-env.

Running conda update conda-env gives " "Ensuring that C:\Users\Admin\Anaconda2\Library\bin is on user PATH environment variable." "" was unexpected at this time. Error: Error: post-link failed for: conda-env-2.4.4-py27_1 " "conda update conda" and "conda update --all" were tried and gave the similar post-link failed error.

ghost commented 8 years ago

So can someone summarize what the status of this issue is or its solution? I've read this thread a couple of times and cannot figure out what ought to be done to fix the problem....

Upgrading to anaconda 2.4 (conda update conda...conda install anaconda=2.4) led to the error:

import matplotlib._png as _png ImportError: DLL load failed: The specified module could not be found.

Downgrading to anaconda 2.3 fixed this (fortunately), but I'd like to be able to use 2.4 on my Windows machine

msarahan commented 8 years ago

This issue should be fixed. The relevant fixed packages were:

python-2.7.10-4. python-3.4.3-4 python-3.5.0-3

conda-env-2.4.4 (build 2) menuinst-1.2.2

The fix is that the conda-env post-link script has been removed. It has been replaced by a modified Lib/site.py file in each Python installation, plus a library_bin.pth file in each Python installation. The combination of these lead to Library/bin being added to os.environ["PATH"] for any Python process. Any programs you install that end up in Library/bin (for example, patch) will still not be on PATH for older installations. You can either modify PATH to add Library/bin yourself, or uninstall and reinstall using a new installer (Anaconda >= 2.4.0; Miniconda >= 3.18)

Due to the nature of metapackages, conda install anaconda=2.4 will actually NOT fix this problem. The anaconda metapackage represents a frozen state of the distribution, which in this case exhibits an issue wherein DLLs located within the Library/bin folder are not found. It would, however, work to say:

conda install anaconda=2.4
conda update --all

because the Library/bin PATH gets added by Python itself in the above mentioned packages, rather than depending on this being set in your system's PATH environment variable.

However, this then leads to the current issue on Python 3 that our package index is in a bad state. Sorry, I'm new, and @ilanschnell, the master of this stuff, is on vacation until Wednesday. I'm trying to rebuild packages to restore the index, but have not succeeded thus far.

himadri111 commented 8 years ago

Just for info: following the steps outlined in the prior comment by msarahan worked for my python 2.7 install (also info on comments on #1786): 1) delete the .conda-env-post-link.bat in C:\Users\Admin\Anaconda2\Scripts 2) conda update python (this also installed conda-env). In this step the python version was downgraded on default settings: sorry, can't see which version now. 3) conda update --all (in this step the python version was upgraded to python 2.7.10-4 4) "conda install chaco" then ran with no errors

C:\Users\Admin\Anaconda2\Library\bin is in PATH.

Thanks.

ghost commented 8 years ago

Great! Thanks so much for the feedback!

marscher commented 8 years ago

@msarahan thank you for figuring this out. I can confirm that only deleting .conda-env-post-link.bat manually makes it possible to upgrade.

marscher commented 8 years ago

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?

marscher commented 8 years ago

https://ci.appveyor.com/project/marscher/pyemma/build/1.0.1374/job/w0bnt2f0fwuq2hhg

msarahan commented 8 years ago

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 commented 8 years ago

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

msarahan commented 8 years ago

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?

marscher commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

@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 https://github.com/conda/conda/issues/1779#issuecomment-154563957

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 commented 8 years ago

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