dofuuz / python-soxr

Fast and high quality sample-rate conversion library for Python
Other
78 stars 6 forks source link

'import soxr' fails: ImportError: cannot import name '__version__' from 'soxr._version' #21

Closed yurivict closed 1 year ago

yurivict commented 1 year ago
$ python3.9
Python 3.9.17 (main, Aug  6 2023, 01:11:50) 
[Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc1238 on freebsd13
Type "help", "copyright", "credits" or "license" for more information.
>>> import soxr
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/soxr/__init__.py", line 12, in <module>
    from ._version import __version__
ImportError: cannot import name '__version__' from 'soxr._version' (/usr/local/lib/python3.9/site-packages/soxr/_version.py)
>>> 

version is defined but __version__ isn't. Not sure why other scripts expect __version__.

$ cat /usr/local/lib/python3.9/site-packages/soxr/_version.py
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '0.3.6'
version_tuple = (0, 3, 6)

Version: 0.3.6 python-3.9 FreeBSD 13.2

dofuuz commented 1 year ago

How did you installed python-soxr?

yurivict commented 1 year ago

I installed python-soxr using a FreeBSD port. The problem existed before I patched it for this specific problem.

The port just runs build and installer modules in order to build/install it according to PEP517.

dofuuz commented 1 year ago

Confirmed. This will be solved in next version. Thank you for reporting.

dofuuz commented 1 year ago

Some additional note: setuptools_scm template has been changed in v7.0.0. I changed the import to support setuptools_scm<7.