alecsandrei / PySAGA-cmd

PySAGA-cmd is a simple way of running SAGA GIS tools using Python.
MIT License
2 stars 0 forks source link

ImportError with 'Self' from 'typing' in Python 3.10 #1

Closed runker54 closed 4 months ago

runker54 commented 4 months ago

Issue Description

I encountered an ImportError when trying to import the SAGA class from the PySAGA_cmd library. The error message indicates that it cannot import Self from the typing module.

Environment

Operating System: WIN11 Python Version: 3.10 PySAGA_cmd Version: 1.0.6

Steps to Reproduce

  1. Install the PySAGA_cmd library.

  2. Attempt to execute the following code:

    from PySAGA_cmd import SAGA
    saga = SAGA(r"D:\Software\saga-9.3.0_x64\saga_cmd.exe")
    
    ImportError: cannot import name 'Self' from 'typing' (D:\Programs\Python\Python310\lib\typing.py)


**Thank you for your time and effort, looking forward to your response.**
alecsandrei commented 4 months ago

Hello,

Thank you for this issue. Will implement a fix later today. It's because Self is only available from Python 3.11 onwards.

alecsandrei commented 4 months ago

the commit bac37ea solved the issue