openeemeter / eeweather

Fetch NCDC ISD, TMY3, or CZ2010 weather data that corresponds to ZIP Code Tabulation Areas or Latitude/Longitude.
http://eeweather.openee.io/
Apache License 2.0
50 stars 19 forks source link

OSError: [WinError 126] The specified module could not be found #64

Open chrisnmills opened 4 years ago

chrisnmills commented 4 years ago

Describe the bug Trying to follow the basic example, I execute import eeweather ranked_stations = eeweather.rank_stations(35, -95)

What results is this traceback and OSError: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\chris.mills\Miniconda3\envs\openee\lib\site-packages\eeweather\ranking.py", line 231, in rank_stations site_climate_zones = get_lat_long_climate_zones(site_latitude, site_longitude) File "C:\Users\chris.mills\Miniconda3\envs\openee\lib\site-packages\eeweather\geo.py", line 120, in get_lat_long_climate_zones from shapely.geometry import Point File "C:\Users\chris.mills\Miniconda3\envs\openee\lib\site-packages\shapely\geometry\__init__.py", line 4, in <module> from .base import CAP_STYLE, JOIN_STYLE File "C:\Users\chris.mills\Miniconda3\envs\openee\lib\site-packages\shapely\geometry\base.py", line 18, in <module> from shapely.coords import CoordinateSequence File "C:\Users\chris.mills\Miniconda3\envs\openee\lib\site-packages\shapely\coords.py", line 8, in <module> from shapely.geos import lgeos File "C:\Users\chris.mills\Miniconda3\envs\openee\lib\site-packages\shapely\geos.py", line 145, in <module> _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll')) File "C:\Users\chris.mills\Miniconda3\envs\openee\lib\ctypes\__init__.py", line 348, in __init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] The specified module could not be found

I get this in both the python interpreter and in jupyter lab, and on two different computers using the steps that follow.

To Reproduce Steps to reproduce the behavior:

  1. I have created a fresh conda environment with python=3.6 and then activated it.
  2. Ran pip install eeweather.
  3. Started the python interpreter or created a new notebook in jupyter lab.
  4. import eeweather
  5. ranked_stations = eeweather.rank_stations(35, -95)

Expected behavior As discussed in the documentation: https://eeweather.readthedocs.io/en/latest/basics.html

Screenshots If applicable, add screenshots to help explain your problem. Here's what's installed in my environment. eeweather_conda_list

Desktop (please complete the following information):

Additional context Is it simply that Windows isn't supported, so I'm better off using Linux?

chrisnmills commented 4 years ago

I just loaded up a Ubuntu VM in VirtualBox and followed the same steps there. This time I got the expected behavior rather than an error, so I guess I'm going to be working in Linux for the time being.

hareesh-bidgely commented 4 years ago

@philngo even I am also getting the same issue on my windows 10 machine in Jupyter notebook. python3.7.4

import eeweather ranked_stations = eeweather.rank_stations(35, -95)

error:


OSError Traceback (most recent call last)

in 1 import eeweather ----> 2 ranked_stations = eeweather.rank_stations(35, -95) 3 ~\Anaconda3\lib\site-packages\eeweather\ranking.py in rank_stations(site_latitude, site_longitude, site_state, site_elevation, match_iecc_climate_zone, match_iecc_moisture_regime, match_ba_climate_zone, match_ca_climate_zone, match_state, minimum_quality, minimum_tmy3_class, max_distance_meters, max_difference_elevation_meters, is_tmy3, is_cz2010) 229 candidates["difference_elevation_meters"] = difference_elevation_meters 230 --> 231 site_climate_zones = get_lat_long_climate_zones(site_latitude, site_longitude) 232 site_iecc_climate_zone = site_climate_zones["iecc_climate_zone"] 233 site_iecc_moisture_regime = site_climate_zones["iecc_moisture_regime"] ~\Anaconda3\lib\site-packages\eeweather\geo.py in get_lat_long_climate_zones(latitude, longitude) 118 """ 119 try: --> 120 from shapely.geometry import Point 121 except ImportError: # pragma: no cover 122 raise ImportError("Finding climate zone of lat/long points requires shapely.") ~\Anaconda3\lib\site-packages\shapely\geometry\__init__.py in 2 """ 3 ----> 4 from .base import CAP_STYLE, JOIN_STYLE 5 from .geo import box, shape, asShape, mapping 6 from .point import Point, asPoint ~\Anaconda3\lib\site-packages\shapely\geometry\base.py in 17 18 from shapely.affinity import affine_transform ---> 19 from shapely.coords import CoordinateSequence 20 from shapely.errors import WKBReadingError, WKTReadingError 21 from shapely.geos import WKBWriter, WKTWriter ~\Anaconda3\lib\site-packages\shapely\coords.py in 6 from ctypes import byref, c_double, c_uint 7 ----> 8 from shapely.geos import lgeos 9 from shapely.topology import Validating 10 ~\Anaconda3\lib\site-packages\shapely\geos.py in 152 if os.getenv('CONDA_PREFIX', ''): 153 # conda package. --> 154 _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll')) 155 else: 156 try: ~\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error) 362 363 if handle is None: --> 364 self._handle = _dlopen(self._name, mode) 365 else: 366 self._handle = handle OSError: [WinError 126] The specified module could not be found
hareesh-bidgely commented 4 years ago

but the same working fine in ubuntu