ajdawson / windspharm

A Python library for spherical harmonic computations on vector winds.
http://ajdawson.github.io/windspharm
MIT License
82 stars 36 forks source link

'module' object has no attribute 'shaesi' #86

Closed jdb2303 closed 6 years ago

jdb2303 commented 6 years ago

I've just installed both windspharm and pyspharm and am currently trying to get the example here to work before adapting it for my own uses. I can successfully load windspharm and the code works up until the line:

w = VectorWind(uwnd, vwnd)

which produces the error:

'module' object has no attribute 'shaesi'

I'm not sure if this is an issue with windspharm or pyspharm, but I thought I'd try here as Google hasn't provided any answers. Thanks!

ajdawson commented 6 years ago

That will be something inside pyspharm. Can you provide details on how you installed windspharm and pyspharm please, and which versions of each you are using.

ajdawson commented 6 years ago

Also the full traceback would be helpful.

jdb2303 commented 6 years ago

I pip installed them. I'm using windspharm version 1.5.1 and pyspharm version 1.0.8. Here is the full traceback:

AttributeError Traceback (most recent call last)

in () ----> 1 w = windspharm.standard.VectorWind(uwnd, vwnd) /home/qy003299/canopy-env/lib/python2.7/site-packages/windspharm-1.5.1-py2.7.egg/windspharm/standard.pyc in __init__(self, u, v, gridtype, rsphere) 103 self.gridtype = gridtype.lower() 104 self.s = Spharmt(nlon, nlat, gridtype=self.gridtype, --> 105 rsphere=rsphere) 106 except ValueError: 107 if self.gridtype not in ('regular', 'gaussian'): /home/qy003299/canopy-env/lib/python2.7/site-packages/spharm/spharm.pyc in __init__(self, nlon, nlat, rsphere, gridtype, legfunc) 244 lshaes = (n1*n2*(nlat + nlat - n1 + 1))/2 + nlon + 15 245 lwork = 5*nlat*n2 + 3*((n1 - 2)*(nlat + nlat - n1 -1))/2 --> 246 wshaes, ierror = _spherepack.shaesi(nlat, nlon, lshaes, lwork, nlat+1) 247 if ierror != 0: 248 msg = 'In return from call to shaesi in Spharmt.__init__ ierror = %d' % ierror AttributeError: 'module' object has no attribute 'shaesi'
ajdawson commented 6 years ago

Are you sure the pip install of pyspharm was successful? shaesi is a fortran subroutine wrapped by f2py, and should always be present in a successful build.

jdb2303 commented 6 years ago

I just tried pip uninstalling pyspharm, and then pip installing it again and it says it installed successfully. It's still not working though, so presumably something's going wrong somewhere during installation.

ajdawson commented 6 years ago

I can't even pip install it, looks like the download link on PyPI isn't there... I don't know what's going on there. Anyway, I suggest downloading from github and installing from source.

I usually recommend conda + conda-forge for installing these packages as it takes the pain out of it.

jdb2303 commented 6 years ago

I tried downloading it from github and it still didn't work - not sure why but I've now installed both pyspharm and windspharm using Anaconda and it's all working - thanks for your help!