NCAR / wrf-python

A collection of diagnostic and interpolation routines for use with output from the Weather Research and Forecasting (WRF-ARW) Model.
https://wrf-python.readthedocs.io
Apache License 2.0
410 stars 155 forks source link

Cannot use the "from wrf import getvar, latlon_coords, ALL_TIMES" #111

Closed wk-atmchem closed 4 years ago

wk-atmchem commented 4 years ago

I'm new to Python. I'm trying in import random words from words. I'm facing this issue. Help me out anyone.

Traceback (most recent call last):

File "C:\Users\wukai\OneDrive\desktop\pythonscripts\wrf.py", line 14, in from wrf import getvar, latlon_coords, ALL_TIMES

File "C:\Users\wukai\OneDrive\desktop\pythonscripts\wrf.py", line 14, in from wrf import getvar, latlon_coords, ALL_TIMES

ImportError: cannot import name 'getvar'

And I have checked that I installed the wrf-python successfully.

jthielen commented 4 years ago

It looks like the file you are running this from is wrf.py, which may cause a name conflict with the wrf-python module named wrf. Have you tried running the same import statement from a REPL prompt (such as you get when you run python or ipython) in a different directory/folder or script with another name?

wk-atmchem commented 4 years ago

Hi Thielen, I tried to rename the script to processwrf.py and now it works well. Thanks! BTW, nice to meet you!

jthielen commented 4 years ago

Glad to hear that helped!