Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Python curses module missing

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Kromitvs
Posts: 14
Joined: 2013-11-09 12:13

Python curses module missing

#1 Post by Kromitvs »

Hello

I'm using Debian 10.9, Buster and Python 3.7.3

And it seems curses module is missing.

Code: Select all

python3
Python 3.7.3 (default, Apr 20 2019, 16:08:10) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/curses/__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'
Is this a configuration issue?

dice
Posts: 17
Joined: 2021-01-16 10:53

Re: Python curses module missing

#2 Post by dice »

Kromitvs wrote:Hello

I'm using Debian 10.9, Buster and Python 3.7.3

And it seems curses module is missing.

Code: Select all

python3
Python 3.7.3 (default, Apr 20 2019, 16:08:10) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/curses/__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'
Is this a configuration issue?
Why do you have GCC 6.3 from 2017, you should have atleast GCC 8.3 ?

Maybe you have not updated your system properly.

Kromitvs
Posts: 14
Joined: 2013-11-09 12:13

Re: Python curses module missing

#3 Post by Kromitvs »

I had that version installed in the past.
But I removed it now.

Code: Select all

$ aptitude search ~igcc
i   gcc                                                - GNU C compiler                                              
i A gcc-8                                              - GNU C compiler                                              
i A gcc-8-arm-linux-gnueabihf                          - GNU C compiler                                              
i A gcc-8-arm-linux-gnueabihf-base                     - GCC, the GNU Compiler Collection (base package)             
i A gcc-8-base                                         - GCC, the GNU Compiler Collection (base package)             
i A gcc-8-base:i386                                    - GCC, the GNU Compiler Collection (base package)             
i A gcc-8-cross-base                                   - GCC, the GNU Compiler Collection (library base package)     
i A gcc-arm-linux-gnueabihf                            - GNU C compiler for the armhf architecture                   
i A lib32gcc1                                          - GCC support library (32 bit Version)                        
i A libgcc-8-dev                                       - GCC support library (development files)                     
i A libgcc-8-dev-armhf-cross                           - GCC support library (development files)                     
i   libgcc1                                            - GCC support library                                         
i A libgcc1:i386                                       - GCC support library                                         
i A libgcc1-armhf-cross                                - GCC support library                                         
i A linux-compiler-gcc-8-x86                           - Compiler for Linux on x86 (meta-package)                    
I also reinstalled Python3.7-minimal, without any changes.

Code: Select all

$ python3
Python 3.7.3 (default, Apr 20 2019, 16:08:10) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/curses/__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'
I do routine upgrade with

Code: Select all

aptitude update && aptitude full-upgrade
How do I fix this?

dice
Posts: 17
Joined: 2021-01-16 10:53

Re: Python curses module missing

#4 Post by dice »

Probably purge python3 and then reinstall python3.

arzgi
Posts: 1197
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 32 times

Re: Python curses module missing

#5 Post by arzgi »

Code: Select all

$ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
>>> 
$ apt-file search _curses | grep python3
glances: /usr/lib/python3/dist-packages/glances/outputs/glances_curses.py
glances: /usr/lib/python3/dist-packages/glances/outputs/glances_curses_browser.py
libpython3.7-dbg: /usr/include/python3.7dm/py_curses.h
libpython3.7-dbg: /usr/lib/python3.7/lib-dynload/_curses.cpython-37dm-x86_64-linux-gnu.so
libpython3.7-dbg: /usr/lib/python3.7/lib-dynload/_curses_panel.cpython-37dm-x86_64-linux-gnu.so
libpython3.7-dev: /usr/include/python3.7m/py_curses.h
libpython3.7-stdlib: /usr/lib/python3.7/lib-dynload/_curses.cpython-37m-x86_64-linux-gnu.so
libpython3.7-stdlib: /usr/lib/python3.7/lib-dynload/_curses_panel.cpython-37m-x86_64-linux-gnu.so
libpython3.7-testsuite: /usr/lib/python3.7/test/test_curses.py
python3-astroid: /usr/lib/python3/dist-packages/astroid/brain/brain_curses.py
python3-mypy: /usr/lib/python3/dist-packages/mypy/typeshed/stdlib/3/_curses.pyi
~$ 
Compare with diff what is missing.

Kromitvs
Posts: 14
Joined: 2013-11-09 12:13

Re: Python curses module missing

#6 Post by Kromitvs »

curses is part of standard Python, so it is in `libpython3.7-stdlib`. But this package is mandatory for Pyhton, so it is already installed.

Really at a loss here.

EDIT: reinstalled every python3 package.


This doesn't happen in your machines?
Last edited by Kromitvs on 2021-04-14 15:29, edited 1 time in total.

arzgi
Posts: 1197
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 32 times

Re: Python curses module missing

#7 Post by arzgi »

What

Code: Select all

apt policy
produces?

Kromitvs
Posts: 14
Joined: 2013-11-09 12:13

Re: Python curses module missing

#8 Post by Kromitvs »

Code: Select all

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://packages.microsoft.com/repos/code stable/main armhf Packages
     release o=code stable,a=stable,n=stable,l=code stable,c=main,b=armhf
     origin packages.microsoft.com
 500 http://packages.microsoft.com/repos/code stable/main arm64 Packages
     release o=code stable,a=stable,n=stable,l=code stable,c=main,b=arm64
     origin packages.microsoft.com
 500 http://packages.microsoft.com/repos/code stable/main amd64 Packages
     release o=code stable,a=stable,n=stable,l=code stable,c=main,b=amd64
     origin packages.microsoft.com
 500 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages
     release v=1.0,o=Google LLC,a=stable,n=stable,l=Google,c=main,b=amd64
     origin dl.google.com
 500 http://download.opensuse.org/repositories/shells:/fish/Debian_10  Packages
     release o=obs://build.opensuse.org/shells:fish/Debian_10,n=Debian_10,l=shells:fish,c=
     origin download.opensuse.org
 500 https://download.docker.com/linux/debian buster/stable amd64 Packages
     release o=Docker,a=buster,l=Docker CE,c=stable,b=amd64
     origin download.docker.com
 100 http://deb.debian.org/debian buster-backports/main armhf Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=main,b=armhf
     origin deb.debian.org
 100 http://deb.debian.org/debian buster-backports/main i386 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=main,b=i386
     origin deb.debian.org
 100 http://deb.debian.org/debian buster-backports/main amd64 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=main,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian buster-updates/non-free armhf Packages
     release o=Debian,a=stable-updates,n=buster-updates,l=Debian,c=non-free,b=armhf
     origin deb.debian.org
 500 http://deb.debian.org/debian buster-updates/non-free i386 Packages
     release o=Debian,a=stable-updates,n=buster-updates,l=Debian,c=non-free,b=i386
     origin deb.debian.org
 500 http://deb.debian.org/debian buster-updates/non-free amd64 Packages
     release o=Debian,a=stable-updates,n=buster-updates,l=Debian,c=non-free,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian buster-updates/main armhf Packages
     release o=Debian,a=stable-updates,n=buster-updates,l=Debian,c=main,b=armhf
     origin deb.debian.org
 500 http://deb.debian.org/debian buster-updates/main i386 Packages
     release o=Debian,a=stable-updates,n=buster-updates,l=Debian,c=main,b=i386
     origin deb.debian.org
 500 http://deb.debian.org/debian buster-updates/main amd64 Packages
     release o=Debian,a=stable-updates,n=buster-updates,l=Debian,c=main,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian-security buster/updates/non-free i386 Packages
     release v=10,o=Debian,a=stable,n=buster,l=Debian-Security,c=non-free,b=i386
     origin deb.debian.org
 500 http://deb.debian.org/debian-security buster/updates/non-free amd64 Packages
     release v=10,o=Debian,a=stable,n=buster,l=Debian-Security,c=non-free,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian-security buster/updates/main armhf Packages
     release v=10,o=Debian,a=stable,n=buster,l=Debian-Security,c=main,b=armhf
     origin deb.debian.org
 500 http://deb.debian.org/debian-security buster/updates/main i386 Packages
     release v=10,o=Debian,a=stable,n=buster,l=Debian-Security,c=main,b=i386
     origin deb.debian.org
 500 http://deb.debian.org/debian-security buster/updates/main amd64 Packages
     release v=10,o=Debian,a=stable,n=buster,l=Debian-Security,c=main,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian buster/non-free armhf Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=non-free,b=armhf
     origin deb.debian.org
 500 http://deb.debian.org/debian buster/non-free i386 Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=non-free,b=i386
     origin deb.debian.org
 500 http://deb.debian.org/debian buster/non-free amd64 Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=non-free,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian buster/contrib armhf Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=contrib,b=armhf
     origin deb.debian.org
 500 http://deb.debian.org/debian buster/contrib i386 Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=contrib,b=i386
     origin deb.debian.org
 500 http://deb.debian.org/debian buster/contrib amd64 Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=contrib,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian buster/main armhf Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=main,b=armhf
     origin deb.debian.org
 500 http://deb.debian.org/debian buster/main i386 Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=main,b=i386
     origin deb.debian.org
 500 http://deb.debian.org/debian buster/main amd64 Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=main,b=amd64
     origin deb.debian.org
Pinned packages:


Kromitvs
Posts: 14
Joined: 2013-11-09 12:13

Re: Python curses module missing

#9 Post by Kromitvs »

I had run pip as root, so I was running a mixed installation of '/usr/local/' (not default debian) and '/usr/bin/python'.

What hinted that was the result of

Code: Select all

print(sys.path)
showing results in /usr/local

To fix it I rename the folder/usr/local/python3 to /usr/local/python3.old and run

Code: Select all

aptitute reinstall ~ipython3

arzgi
Posts: 1197
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 32 times

Re: Python curses module missing

#10 Post by arzgi »

Good you got it solved, though your mileage may vary with those sources.

Post Reply