fitnr/svgis

Cannot import name 'SIGPIPE' from 'signal'

spajak opened this issue · 4 comments

Windows 10 64bit
Python 3.8.6

> svgis.exe draw GSHHS_i_L1.shp -o tmp.svg
Traceback (most recent call last):
  File "d:\applications\python\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "d:\applications\python\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\Applications\packages\python\Scripts\svgis.exe\__main__.py", line 4, in <module>
  File "D:\Applications\packages\python\Lib\site-packages\svgis\cli.py", line 11, in <module>
    from signal import signal, SIGPIPE, SIG_DFL
ImportError: cannot import name 'SIGPIPE' from 'signal' (d:\applications\python\lib\signal.py)

Having the same problem.
Windows 10 x64
Python 3.7.0
Fiona 1.8.18

I installed Python and GDAL through OSGeo4W - https://trac.osgeo.org/osgeo4w/wiki
Then I installed the precompiled version of Fiona from https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona
specifically I used Fiona‑1.8.18‑cp37‑cp37m‑win_amd64.whl

Fiona and GDAL seem to work fine, but running any command for SVGIS gives me the same error as @spajak though the paths are slightly different.

I have environment variables set for system and user
GDAL_CONFIG : C:\OSGeo4W64\bin\gdal-config.bat
GDAL_VERSION : 3.1.4
PYTHONHOME : C:\OSGeo4W64\apps\Python37
PYTHONPATH : C:\OSGeo4W64\apps\Python37\lib\site-packages
PATH : C:\OSGeo4W64\bin - C:\OSGeo4W64\apps\Python37\Scripts

I have restarted the computer a few times and get the same error.
I've tried with Command Line, and Powershell as user and admin.

Command I used for svgis
svgis draw .\xxxx-hampton.mill.geojson --id-field name -o hampton-mill.svg

@spajak Possible solution:

Find the file cli.py in the svgis folder, for me this was located at:
C:\OSGeo4W64\apps\Python37\lib\site-packages\svgis

Open cli.py and edit it.
Comment out these two lines:
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE, SIG_DFL)

This fixed the error for me and I was able to export an SVG from a GeoJSON file.

fitnr commented

This is a nicety for handling command-line interruptions that's not available on Windows. I will remove from the next release

Thanks