[issue46579] Compiling from source prints «ModuleNotFoundError: No module named 'binascii'»

2022-01-30 Thread Christian Heimes


Christian Heimes  added the comment:

CPython's build system does not depend on setuptools.

The problem is that setuptools 60.0 introduced a .pth file and _distutils_hack 
to inject itself into Python import system. Under some circumstances Python's 
build system is affected by the hack and breaks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46579] Compiling from source prints «ModuleNotFoundError: No module named 'binascii'»

2022-01-30 Thread Дилян Палаузов

Дилян Палаузов  added the comment:

The problem is, that Python’s install target depends on the system-wide 
setuptools, if there is system-wide setuptools.  If there is no system-wide 
installed setuptools, apparently the installation works flawlessly.

The solution is to tweak the source code of Python, not to depend on 
(system-wide installed) Python code outside of Python’s tarball.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46579] Compiling from source prints «ModuleNotFoundError: No module named 'binascii'»

2022-01-30 Thread Christian Heimes


Christian Heimes  added the comment:

You are affected by setuptools bug 
https://github.com/pypa/setuptools/issues/3007 . The setuptools issues has a 
workaround. The next version of setuptools will come with a fix.

--
nosy: +christian.heimes
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46579] Compiling from source prints «ModuleNotFoundError: No module named 'binascii'»

2022-01-30 Thread Дилян Палаузов

New submission from Дилян Палаузов :

I compile python from source:

$ python --version
Python 3.10.1+
$ cat /etc/config.site 
ax_cv_c_float_words_bigendian=no
enable_silent_rules=yes
$ git describe 
v3.10.2-74-ga5451c96a1
$ ./configure --enable-loadable-sqlite-extensions --disable-ipv6 
--with-system-expat --with-system-libmpdec --enable-shared
$ make
gcc -c -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration 
-fvisibility=hidden  -I./Include/internal  -I. -I./Include   -fPIC 
-DPy_BUILD_CORE -o Modules/_math.o Modules/_math.c
LD_LIBRARY_PATH=/git/cpython CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG 
-g -fwrapv -O3 -Wall'_TCLTK_INCLUDES='-I/usr/local/include' 
_TCLTK_LIBS='-L/usr/local/lib -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6'
 ./python -E ./setup.py  build
Traceback (most recent call last):
  File "/git/cpython/./setup.py", line 50, in 
from distutils.command.install import install
  File 
"/usr/local/lib/python3.10/site-packages/setuptools/_distutils/command/install.py",
 line 20, in 
from .. import _collections
  File "/usr/local/lib/python3.10/site-packages/setuptools/__init__.py", line 
16, in 
import setuptools.version
  File "/usr/local/lib/python3.10/site-packages/setuptools/version.py", line 1, 
in 
import pkg_resources
  File "/usr/local/lib/python3.10/site-packages/pkg_resources/__init__.py", 
line 23, in 
import zipfile
  File "/git/cpython/Lib/zipfile.py", line 6, in 
import binascii
ModuleNotFoundError: No module named 'binascii'
make: *** [Makefile:637: sharedmods] Error 1


When I compiled python 3.10 using python 3.8 one or two months ago, there was 
no such problem.

Compiling python from source code, shall use the bundled distutils, not the 
installed one.

My Linux From Scratch system appears not to have module binascii:

$ locate binascii
/usr/local/lib/python3.10/lib-dynload/binascii.cpython-310-x86_64-linux-gnu.so
/usr/local/lib/python3.10/test/__pycache__/test_binascii.cpython-310.opt-1.pyc
/usr/local/lib/python3.10/test/__pycache__/test_binascii.cpython-310.opt-2.pyc
/usr/local/lib/python3.10/test/__pycache__/test_binascii.cpython-310.pyc
/usr/local/lib/python3.10/test/test_binascii.py
/usr/local/lib/python3.8/lib-dynload/binascii.cpython-38-x86_64-linux-gnu.so
/usr/local/lib/python3.8/site-packages/mypy/typeshed/stdlib/@python2/binascii.pyi
/usr/local/lib/python3.8/site-packages/mypy/typeshed/stdlib/binascii.pyi
/usr/local/lib/python3.8/test/__pycache__/test_binascii.cpython-38.opt-1.pyc
/usr/local/lib/python3.8/test/__pycache__/test_binascii.cpython-38.opt-2.pyc
/usr/local/lib/python3.8/test/__pycache__/test_binascii.cpython-38.pyc
/usr/local/lib/python3.8/test/test_binascii.py
/git/cpython/Modules/binascii.c
/git/cpython/Modules/clinic/binascii.c.h
/git/cpython/Lib/test/test_binascii.py
/git/cpython/Doc/library/binascii.rst

--
components: Installation
messages: 412134
nosy: dilyan.palauzov
priority: normal
severity: normal
status: open
title: Compiling from source prints «ModuleNotFoundError: No module named 
'binascii'»
type: compile error
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com