Ask Your Question
1

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

asked 2021-05-21 16:10:34 +0100

Max Alekseyev gravatar image

updated 2021-05-21 16:14:01 +0100

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?

edit retag flag offensive reopen merge delete

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 ( 2021-05-21 22:52:47 +0100 )edit

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

Max Alekseyev gravatar imageMax Alekseyev ( 2021-05-21 23:28:36 +0100 )edit

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 ( 2021-05-21 23:50:45 +0100 )edit

I can share a full log if needed.

Max Alekseyev gravatar imageMax Alekseyev ( 2021-05-22 17:18:42 +0100 )edit

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

John Palmieri gravatar imageJohn Palmieri ( 2021-05-22 18:47:05 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2021-08-17 23:48:21 +0100

Max Alekseyev gravatar image

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

edit flag offensive delete link more
0

answered 2021-05-22 10:21:37 +0100

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
edit flag offensive delete link more

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 ( 2021-05-22 11:51:25 +0100 )edit

Are those packages up to date?

John Palmieri gravatar imageJohn Palmieri ( 2021-05-22 18:45:27 +0100 )edit

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

Max Alekseyev gravatar imageMax Alekseyev ( 2021-05-22 19:35:04 +0100 )edit

Question Tools

1 follower

Stats

Asked: 2021-05-21 16:10:34 +0100

Seen: 2,366 times

Last updated: Aug 17 '21