Skip to content

Depreciated dependency on python 3.12 (numpy.distutils) causes error on import #305

@Gerrit-Hoving

Description

@Gerrit-Hoving

Describe the bug
Attempting to import rasterstats on Python 3.12 results in the following error:
File ~/.conda/envs/comps/lib/python3.12/site-packages/rasterstats/main.py:8
import numpy.distutils.system_info as sysinfo

ModuleNotFoundError: No module named 'numpy.distutils'

I believe that this is because numpy.distutils has been depreciated and removed as of Python 3.12 (https://numpy.org/doc/2.1/reference/distutils_status_migration.html#distutils-status-migration).

To Reproduce
I was able to reproduce this error on both Windows 11 and Linux (arch) by creating a new anaconda env with the latest python version, installing spyder and rasterstats, and attempting to import rasterstats into my script in spyder

import rasterstats

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions