Skip to content
Advertisement

ImportError: cannot import name ‘build_py_2to3’ from ‘distutils.command.build_py’

I tried to install bipwallet through pip but it says there is no ‘build_py_2to3’ in distutils

JavaScript

I tried to search in Google but it did not help. I also tried pip install --upgrade distutils thinking maybe it’s just older version.

P.S. my python version 3.11

Advertisement

Answer

It seems as though bipwallet or one of its dependencies (protobuf-3.0.0a3?) wants to use whatever version of setuptools is available rather than pinning a specific version. setuptools v58.0.0 has a breaking change, first included in Python 3.10, where build_py_2to3 was removed.

You have a couple options:

  1. Find the offending library and edit its setup.py to indicate that it should use setuptools<=57.5.0 and retry.
  2. Downgrade your Python installation to 3.9 to get a local version of setuptools prior to the breaking change.

Here are a couple other related posts/links to the issue you’re seeing:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement