Issue
I'm trying to change the font color in the legend of a barplot by setting the labelcolor parameter, and it looks like I'll need Matplotlib 3.3 or later to do so (currently I'm getting TypeError: __init__() got an unexpected keyword argument 'labelcolor'
when I try). I currently have 3.2.2 installed.
I tried running conda install -c conda-forge matplotlib
in both my base environment and a custom environment, and it just "updated" to 3.2.2 again. I'd prefer to avoid trying a pip install so I don't risk screwing up other packages.
Thanks in advance.
Solution
The command
conda install -c conda-forge matplotlib
translates to the imperative
With the conda-forge channel prioritized, ensure that some version of the package
matplotlib
is installed in the current environment.
In contrast, according to OP, we want the imperative statement
Ensure that at least version 3.3 of the
matplotlib
package is installed in the current environment.
which translates to the command
conda install matplotlib[version='>=3.3']
This does not guarantee that Conda can satisfy this command (e.g., it could conflict with previous specifications), only that this is the literal translation.
Channel Specification
Note that including -c conda-forge
will prioritize that channel, but does not explicit specify that Conda must use that channel to source the package. This is because Conda will also take into account the channel_priority
configuration value, and will behave differently depending on whether 'strict'
or 'flexible'
is set.
However, Conda's MatchSpec is sufficiently expressive to explicitly demand a particular package is sourced from a given channel. For example, to demand that at least version 3.3 is installed from Conda Forge, would take the form
conda install conda-forge::matplotlib[version='>=3.3']
Answered By - merv
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.