Ask Your Question
1

"ModuleNotFoundError: No module named 'binascii'" while installing Normaliz in Sage 9.3 [closed]

asked 3 years ago

Max Alekseyev gravatar image

updated 3 years ago

I'm using Sage 9.3. installed from sage-9.3-Ubuntu_20.04-x86_64.tar.bz2.

Running sage -i normaliz from results in the following error:

[python3-3.9.2] LD_LIBRARY_PATH=/home/maxal/SageMath.93/local/var/tmp/sage/build/python3-3.9.2/src CC='gcc -pthread' LDSHARED='gcc -pthread -shared -Wl,-rpath-link,/home/maxal/SageMath.93/local/lib -L/home/maxal/SageMath.93/local/lib -Wl,-rpath,/home/maxal/SageMath.93/local/lib  -L. -Wl,-rpath-link,/home/maxal/SageMath.93/local/lib -L/home/maxal/SageMath.93/local/lib -Wl,-rpath,/home/maxal/SageMath.93/local/lib   ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''   ./python -E ./setup.py  build
[python3-3.9.2] Traceback (most recent call last):
[python3-3.9.2]   File "/home/maxal/SageMath.93/local/var/tmp/sage/build/python3-3.9.2/src/./setup.py", line 33, in <module>
[python3-3.9.2]     from distutils import log
[python3-3.9.2]   File "/home/maxal/SageMath.93/local/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 83, in create_module
[python3-3.9.2]     return importlib.import_module('setuptools._distutils')
[python3-3.9.2]   File "/home/maxal/SageMath.93/local/var/tmp/sage/build/python3-3.9.2/src/Lib/importlib/__init__.py", line 127, in import_module
[python3-3.9.2]     return _bootstrap._gcd_import(name[level:], package, level)
[python3-3.9.2]   File "/home/maxal/SageMath.93/local/lib/python3.9/site-packages/setuptools/__init__.py", line 16, in <module>
[python3-3.9.2]     import setuptools.version
[python3-3.9.2]   File "/home/maxal/SageMath.93/local/lib/python3.9/site-packages/setuptools/version.py", line 1, in <module>
[python3-3.9.2]     import pkg_resources
[python3-3.9.2]   File "/home/maxal/SageMath.93/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 23, in <module>
[python3-3.9.2]     import zipfile
[python3-3.9.2]   File "/home/maxal/SageMath.93/local/var/tmp/sage/build/python3-3.9.2/src/Lib/zipfile.py", line 6, in <module>
[python3-3.9.2]     import binascii
[python3-3.9.2] ModuleNotFoundError: No module named 'binascii'
[python3-3.9.2] make[4]: *** [Makefile:638: sharedmods] Error 1
[python3-3.9.2] ********************************************************************************
[python3-3.9.2] Error building python3-3.9.2
[python3-3.9.2] ********************************************************************************

How to deal with it?

Preview: (hide)

Closed for the following reason question is not relevant or outdated by Max Alekseyev
close date 2022-09-22 22:23:27.152062

Comments

Do you have Python 3 installed system-wide?

John Palmieri gravatar imageJohn Palmieri ( 3 years ago )

Yes, python 3 is installed system-wide and is available as python3.

Max Alekseyev gravatar imageMax Alekseyev ( 3 years ago )

I'm unable to reproduce this, and I'm puzzled as to why sage -i normaliz is trying to build Sage's Python 3 package, and then further why it can't find binascii.

John Palmieri gravatar imageJohn Palmieri ( 3 years ago )

I can share a full log if needed.

Max Alekseyev gravatar imageMax Alekseyev ( 3 years ago )

At least the top level config.log would be helpful.

John Palmieri gravatar imageJohn Palmieri ( 3 years ago )

2 Answers

Sort by » oldest newest most voted
1

answered 3 years ago

Max Alekseyev gravatar image

The problem has been fixed in https://trac.sagemath.org/ticket/32056

Preview: (hide)
link
0

answered 3 years ago

tmonteil gravatar image

The problem does not come from normaliz, but from the fact that Sage tries to recompile Python3, while it should use the one provided by your distro.

Could you please try to install the following packages first :

python3
libpython3-dev
python3-distutils
Preview: (hide)
link

Comments

These 3 packages are already installed on my system. Also, even if Sage decides to recompile Python3, it should not fail to do so, should it?

Max Alekseyev gravatar imageMax Alekseyev ( 3 years ago )

Are those packages up to date?

John Palmieri gravatar imageJohn Palmieri ( 3 years ago )

Yes, all packages in the system are up-to-date.

Max Alekseyev gravatar imageMax Alekseyev ( 3 years ago )

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 2,454 times

Last updated: Aug 17 '21