No module named extern error

198 views
Skip to first unread message

B. P. TBC

unread,
Feb 11, 2022, 4:06:04 PM2/11/22
to sage-support
Hi all!
I installed Sagemath on Linux Mint 19 PC. (Based on Ubuntu 18.04.) After I started it from console, and tried to type "notebook()" command, I got the following error messages:

----- begin -----

----> 1 notebook()

sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:4114)()

sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport._get_object (build/cythonized/sage/misc/lazy_import.c:2568)()

/usr/lib/python2.7/dist-packages/sagenb/__init__.py in <module>()
      1 # -*- coding: utf-8 -*
      2   # init
----> 3 from . import storage

/usr/lib/python2.7/dist-packages/sagenb/storage/__init__.py in <module>()
      1 # -*- coding: utf-8 -*
      2
----> 3 from .filesystem_storage import FilesystemDatastore

/usr/lib/python2.7/dist-packages/sagenb/storage/filesystem_storage.py in <module>()
     50
     51 from .abstract_storage import Datastore
---> 52 from sagenb.misc.misc import set_restrictive_permissions, encoded_str
     53
     54 from sage.misc.temporary_file import atomic_write

/usr/lib/python2.7/dist-packages/sagenb/misc/misc.py in <module>()
     20 #############################################################################
     21
---> 22 from pkg_resources import resource_filename
     23
     24 def stub(f):

/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py in <module>()
     48     import imp as _imp
     49
---> 50 from pkg_resources.extern import six
     51 from pkg_resources.extern.six.moves import urllib, map, filter
     52

ImportError: No module named extern

----- end -----

I installed it from the Linux Mint repo.
Later I installed SageMath on my PC in my workplace (Linux Mint 19, too), but there everything works fine.
Please help, what can be the problem?

Many thanks:
P.

slelievre

unread,
Feb 12, 2022, 5:33:24 AM2/12/22
to sage-support
What SageMath versions do you have at home and at work?
To get the version information, print the Sage banner:

sage: sage.misc.banner.SAGE_BANNER = ''
sage: banner()

David Joyner

unread,
Feb 12, 2022, 5:36:49 AM2/12/22
to SAGE support
A;lso, you can use the version command:

sage: version()
'SageMath version 9.3.rc0, Release Date: 2021-03-23'

> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/be175aab-15be-4c5e-a671-dd1f3298563dn%40googlegroups.com.

slelievre

unread,
Feb 12, 2022, 6:19:43 AM2/12/22
to sage-support


Le samedi 12 février 2022 à 11:36:49 UTC+1, W D Joyner:

Also, you can use the version command:

sage: version()
'SageMath version 9.3.rc0, Release Date: 2021-03-23'


Or to also get the Python version:
```
sage: print('{}, Python {}.{}.{}'.format(version(), *sys.version_info[:3]))
SageMath version 9.6.beta0, Release Date: 2022-02-06, Python 3.9.10
```

More elaborate command for more concise output:
```
sage: print("SageMath {}, released {}. Python {}.{}.{}."
....:       .format(sage.version.version, sage.version.date, *sys.version_info[:3]))
SageMath 9.6.beta0, released 2022-02-06. Python 3.9.10.
```

B. P. TBC

unread,
Feb 14, 2022, 8:24:10 AM2/14/22
to sage-support
Hi

slelievre a következőt írta (2022. február 12., szombat, 12:19:43 UTC+1):

Le samedi 12 février 2022 à 11:36:49 UTC+1, W D Joyner:

Also, you can use the version command:

sage: version()
'SageMath version 9.3.rc0, Release Date: 2021-03-23'


The version: 'SageMath version 8.1, Release Date: 2017-12-07'
 

Or to also get the Python version:
```
sage: print('{}, Python {}.{}.{}'.format(version(), *sys.version_info[:3]))
SageMath version 9.6.beta0, Release Date: 2022-02-06, Python 3.9.10
```
 My version: SageMath version 8.1, Release Date: 2017-12-07, Python 2.7.17
 

Priyanshu Rai

unread,
Feb 14, 2022, 8:24:10 AM2/14/22
to sage-support
Hi, 

The legacy notebook has been disabled in the newer versions of sagemath and Jupyter has been officially accepted as the notebook interface.

To quickly open a sage environment in Jupyter, type the following in your terminal :
`sage -n jupyter`

Jupyter with the Sagemath kernel provides the same or even better functionality than the older legacy notebook.

PS: This problem had troubled even me for sometime :)

Reply all
Reply to author
Forward
0 new messages