mrkn / pycall.rb

Calling Python functions from the Ruby language
MIT License
1.05k stars 72 forks source link

DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead #158

Closed c-dilks closed 1 year ago

c-dilks commented 2 years ago

Testing with Python 3.10.4, I get the following deprecation warnings when importing a python library with PyCall.import_module:

..../.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/pycall-1.4.1/lib/pycall/python/investigator.py:4: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.sysconfig import get_config_var, get_python_version
..../.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/pycall-1.4.1/lib/pycall/python/investigator.py:4: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  from distutils.sysconfig import get_config_var, get_python_version
<module 'numpy' from '/usr/local/lib/python3.10/site-packages/numpy/__init__.py'>

Changing distutils.sysconfig to sysconfig at least silences the warning (see linked PR)