numpy / numpy-stubs

Experimental typing stubs for NumPy
BSD 3-Clause "New" or "Revised" License
282 stars 32 forks source link

How do you use this package? #40

Closed geiszla closed 4 years ago

geiszla commented 4 years ago

I can't find any information on how to install this package to a local workspace. I tried installing the git repo via pip, but mypy still complains when I try to use it ("ndarray" expects no type arguments, but 1 given). I know this is an experimental project, but can I use the parts that are done so far?

mikolajz commented 4 years ago

FWIW it works for me when install by pip from git repo. Maybe if you included a short snippet of code that doesn't work for you? Then we could check if it works for others.

person142 commented 4 years ago

Yes, installing from the repo is the only way to use the stubs for now. From your particular error it sounds like you are trying to do something like ndarray[np.int64], which is not supported yet. See e.g. https://github.com/numpy/numpy-stubs/issues/7 and https://github.com/numpy/numpy-stubs/pull/48 for more context.

person142 commented 4 years ago

(Closing as I believe the question has been answered.)