aspectumapp / osm2geojson

Convert OSM and Overpass XML/JSON to GeoJSON
MIT License
97 stars 15 forks source link

Import Issue On Windows 10 when running from a Network Drive (Mapped) #21

Closed fuser-admin closed 3 years ago

fuser-admin commented 3 years ago

Hi, I am having an issue importing this library. I am in a virtual environment using Anaconda, on Windows 10. Also I am working from a mapped network drive (i.e. from the W:/ drive path, whereas the virtual anaconda environment is stored on the C:/ drive) I am working using Jupyter notebooks.

Here is my traceback error :

OSError                                   Traceback (most recent call last)
<ipython-input-4-d010518df789> in <module>
      1 import os
      2 import codecs # For reading .xml files (.osm) is .xml file
----> 3 import osm2geojson

~\Anaconda3\envs\mindist\lib\site-packages\osm2geojson\__init__.py in <module>
      1 from .parse_xml import parse as parse_xml
      2 from .helpers import read_data_file, overpass_call
----> 3 from .main import xml2geojson, json2geojson, xml2shapes, json2shapes, shape_to_feature

~\Anaconda3\envs\mindist\lib\site-packages\osm2geojson\main.py in <module>
      1 from .parse_xml import parse as parse_xml
----> 2 from shapely.ops import cascaded_union, linemerge
      3 from shapely.geometry import (
      4     mapping, Polygon, Point, LineString, MultiLineString, MultiPolygon, GeometryCollection
      5 )

~\Anaconda3\envs\mindist\lib\site-packages\shapely\ops.py in <module>
     11 from ctypes import byref, c_void_p, c_double
     12 
---> 13 from shapely.prepared import prep
     14 from shapely.geos import lgeos
     15 from shapely.geometry.base import geom_factory, BaseGeometry, BaseMultipartGeometry

~\Anaconda3\envs\mindist\lib\site-packages\shapely\prepared.py in <module>
      3 """
      4 
----> 5 from shapely.geos import lgeos
      6 from shapely.impl import DefaultImplementation, delegated
      7 from pickle import PicklingError

~\Anaconda3\envs\mindist\lib\site-packages\shapely\geos.py in <module>
    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\envs\mindist\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
rapkin commented 3 years ago

Hi, problem with geos dynamic lib. You can find more info about this problem here https://github.com/Toblerity/Shapely/issues/1032