Using the windrose package yields Affine2dbase error

Question:

I am trying a simple python windrose example from here Windrose Notebook Example using Anaconda2. But I get error messages ‘TypeError: unbound method __init__() must be called with Affine2DBase instance as first argument (got Affine2D instance instead)‘ when running the simple code below

from windrose import WindroseAxes
from matplotlib import pyplot as plt
import matplotlib.cm as cm
import numpy as np

ws = np.random.random(500) * 6
wd = np.random.random(500) * 360
ax = WindroseAxes.from_ax()

I am struggling to understand the info on affine2dbase I’ve found online, but thought it might be an issue with my matplotlib installations? Here are the versions I am using

    matplotlib                2.2.3            py27h263d877_0
    matplotlib-base           2.2.5            py27h6595424_1    conda-forge
    windrose                  1.6.7                      py_1    conda-forge
    ipython                   5.8.0                    py27_0

and here is the conda install information for windrose install as administrator:

(base) C:WINDOWSsystem32>conda install -c conda-forge windrose
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:UsersStudentAnaconda2

  added / updated specs:
    - windrose


The following NEW packages will be INSTALLED:

  python_abi         conda-forge/win-64::python_abi-2.7-1_cp27m

The following packages will be UPDATED:

  conda                       pkgs/main::conda-4.8.3-py27_0 --> conda-forge::conda-4.8.3-py27h8c360ce_1


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

I would appreciate input on how to fix windrose so I can run the basic example or how I can mitigate the affine2d error. Thanks

Asked By: squar_o

||

Answers:

As suggested by @fyberoptik the solution was to use pip install windrose in conda prompt. Whilst it doesn’t look like anything changes in anaconda prompt, windrose now plots for the test data and for my own data.

(base) C:UsersStudent>pip install windrose
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already satisfied: windrose in c:usersstudentanaconda2libsite-packages (1.6.7)
    Requirement already satisfied: numpy in c:usersstudentanaconda2libsite-packages (from windrose) (1.16.5)
    Requirement already satisfied: matplotlib in c:usersstudentanaconda2libsite-packages (from windrose) (2.2.5)
    Requirement already satisfied: cycler>=0.10 in c:usersstudentanaconda2libsite-packages (from matplotlib->windrose) (0.10.0)
    Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:usersstudentanaconda2libsite-packages (from matplotlib->windrose) (2.4.2)
    Requirement already satisfied: python-dateutil>=2.1 in c:usersstudentanaconda2libsite-packages (from matplotlib->windrose) (2.8.0)
    Requirement already satisfied: pytz in c:usersstudentanaconda2libsite-packages (from matplotlib->windrose) (2019.3)
    Requirement already satisfied: six>=1.10 in c:usersstudentanaconda2libsite-packages (from matplotlib->windrose) (1.12.0)
    Requirement already satisfied: kiwisolver>=1.0.1 in c:usersstudentanaconda2libsite-packages (from matplotlib->windrose) (1.1.0)
    Requirement already satisfied: backports.functools_lru_cache in c:usersstudentanaconda2libsite-packages (from matplotlib->windrose) (1.5)
    Requirement already satisfied: setuptools in c:usersstudentanaconda2libsite-packages (from kiwisolver>=1.0.1->matplotlib->windrose) (41.4.0)

using the standard example:

ws = np.random.random(500) * 6
wd = np.random.random(500) * 360
ax = WindroseAxes.from_ax()
ax.bar(wd, ws)

enter image description here

Answered By: squar_o