dtw icon indicating copy to clipboard operation
dtw copied to clipboard

python 3.12?

Open fosghen opened this issue 1 year ago • 2 comments

fosghen avatar Jul 17 '24 11:07 fosghen

same problem, here is answer gen by copilot

The error message indicates that the installation of the dtw package is failing because it cannot find the imp module. The imp module was deprecated in Python 3.4 and removed in Python 3.12. The dtw package likely has a dependency that still uses the imp module, which is causing the installation to fail.

To resolve this issue, you can try the following steps:

  1. Check for an Updated Version: Ensure that you are trying to install the latest version of the dtw package. The issue might have been fixed in a newer release.

  2. Use an Alternative Package: If the dtw package is not actively maintained, consider using an alternative package that provides similar functionality.

  3. Modify the Package Source: If you need to use this specific package, you might need to download the source code, modify it to replace the usage of the imp module with importlib, and then install it manually.

  4. Contact the Maintainer: Report the issue to the package maintainer so they can update the package to be compatible with Python 3.12.

For now, you can try installing an older version of Python (e.g., Python 3.10 or 3.11) where the imp module is still available, and then install the dtw package.

jensenojs avatar Oct 07 '24 04:10 jensenojs

I encountered the same issue. However, as far as I can tell from the source code, there’s no place where import imp is actually used. This problem has been solved at #59

The problem seems to be that the version uploaded to PyPI only goes up to v1.4.0, while the current latest version v1.4.1 has not yet been published there: https://pypi.org/project/dtw/#history

In the latest v1.4.1, the imp dependency has been removed. As a result, it can be installed successfully even on Python 3.12. I’ve confirmed that installation works correctly on my local environment (Python 3.12.10).

To install it, you can use the following command:

pip install "git+https://github.com/pollen-robotics/dtw"

decfrr avatar Oct 06 '25 05:10 decfrr