pythonpipcondalinearmodels

Can't load datasets from linearmodel python package


I am trying to learn the linearmodels package for python. I want to do this by practicing with the data sets, as can be seen here. Example code:

import numpy as np
from linearmodels.iv import IV2SLS
from linearmodels.datasets import mroz
data = mroz.load()

But my code breaks when i run data = mroz.load()

error message:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\...\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\linearmodels\\datasets\\mroz\\mroz.csv.bz2'

I have pip version: 19.1.1

Conda can't find the package at all

and i have the latest version of linearmodels package: 4.13

The folder specified in the error message i can find, i.e. datasets\mroz but not the csv.bz2 file.

The same holds for every other data set i try to open.

Why am i not able to open the datasets?

let me know if you need additional information.


Solution

  • This is a bug in the package. If you download and unpack the source distribution you would find it lacks all *.csv.bz2.

    I see two problems in the package. First, MANIFEST.in lists *.csv.bz. It must be *.csv.bz2 or *.csv.bz*.

    Second, they tried to add the datasets in setup.py but also failed, not sure why. Perhaps the files must be declared as belonged to different subpackages, not to the main package.

    Please report the bugs to the issue tracker.