I tried to install bipwallet through pip but it says there is no ‘build_py_2to3’ in distutils
JavaScript
x
28
28
1
Defaulting to user installation because normal site-packages is not writeable
2
Collecting bipwallet
3
4
Collecting protobuf==3.0.0a3
5
Using cached protobuf-3.0.0a3.tar.gz (88 kB)
6
Preparing metadata (setup.py) error
7
error: subprocess-exited-with-error
8
9
× python setup.py egg_info did not run successfully.
10
│ exit code: 1
11
╰─> [6 lines of output]
12
Traceback (most recent call last):
13
File "<string>", line 2, in <module>
14
File "<pip-setuptools-caller>", line 34, in <module>
15
File "/tmp/pip-install-q8v8yny3/protobuf_3f1a8b67130540ab9c93af7fe765918c/setup.py", line 29, in <module>
16
from distutils.command.build_py import build_py_2to3 as _build_py
17
ImportError: cannot import name 'build_py_2to3' from 'distutils.command.build_py' (/home/orkhan/.local/lib/python3.11/site-packages/setuptools/_distutils/command/build_py.py)
18
[end of output]
19
20
note: This error originates from a subprocess, and is likely not a problem with pip.
21
error: metadata-generation-failed
22
23
× Encountered error while generating package metadata.
24
╰─> See above for output.
25
26
note: This is an issue with the package mentioned above, not pip.
27
hint: See above for details.
28
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:
- Find the offending library and edit its
setup.py
to indicate that it should usesetuptools<=57.5.0
and retry. - 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: