Modulenotfounderror no module named curses windows

It's my first time trying to use curses, after successfully installing it with python -m pip install windows-curses, (re-runing this code gives Requirement already satisfied: windows-curses in c:p...

It’s my first time trying to use curses, after successfully installing it with python -m pip install windows-curses, (re-runing this code gives Requirement already satisfied: windows-curses in c:pythonpython37-32libsite-packages (2.1.0)).

I ran the sample code:

import curses
import time

screen = curses.initscr()
screen.clear()
time.sleep(3)

And got the error:

ModuleNotFoundError                       Traceback (most recent call last)
c:UsersCrisDesktoptest.py in 
----> 1 import curses
      2 import time
      3 screen = curses.initscr()
      4 screen.clear()
      5 time.sleep(3)

~Anaconda3libcurses__init__.py in 
     11 """
     12 
---> 13 from _curses import *
     14 import os as _os
     15 import sys as _sys

ModuleNotFoundError: No module named '_curses'

which says curses is not installed…?

I ran this using VSC’s Python Interactive tab (shift+enter), simply running it through VSC gives:

LINES value must be >= 2 and <= 132: got 13682
initscr(): Unable to create SP

Grepper Logo

Add Answer
|
View In TPC Matrix

Technical Problem Cluster First Answered On
August 12, 2020

Popularity
10/10

Helpfulness
10/10


Contributions From The Grepper Developer Community

Contents

Code Examples

  • from _curses import * ModuleNotFoundError: No module named ‘_curses’
  • ModuleNotFoundError: No module named ‘_curses’
  • Related Problems

  • python modulenotfounderror: no module named ‘_curses’
  • configure: error: «curses not found»
  • TPC Matrix View Full Screen

    from _curses import * ModuleNotFoundError: No module named ‘_curses’

    Comment

    10


    Popularity

    10/10 Helpfulness
    10/10
    Language
    python

    Source: Grepper

    Tags: import
    module
    named
    python

    Perfect Panther

    Contributed on Aug 12 2020

    Perfect Panther

    1 Answers  Avg Quality 10/10


    ModuleNotFoundError: No module named ‘_curses’

    Comment

    0


    Popularity

    8/10 Helpfulness
    2/10
    Language
    whatever

    Source: Grepper

    Tags: module
    named
    whatever

    bakkar

    Contributed on Oct 16 2022

    bakkar

    10 Answers  Avg Quality 7/10


    Grepper

    Features
    Reviews
    Code Answers
    Search Code Snippets

    Plans & Pricing
    FAQ
    Welcome
    Browsers Supported
    Grepper Teams

    Documentation

    Adding a Code Snippet

    Viewing & Copying Snippets

    Social

    Twitter LogoTwitter

    LinkedIn LogoLinkedIn

    Legal

    Privacy Policy
    Terms

    Contact

    support@codegrepper.com

    Created on 2017-11-05 22:55 by joe m2, last changed 2022-04-11 14:58 by admin. This issue is now closed.

    Messages (6)
    msg305610 — (view) Author: joe m (joe m2) Date: 2017-11-05 22:55
    Importing curses on Windows install calls the following:
    
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:Usersuser nameAppDataLocalProgramsPythonPython36-32libcurses__init__.py", line 13, in <module>
        from _curses import *
    ModuleNotFoundError: No module named '_curses'
    
    Importing curses as "_curses" does the same thing. I have tried the "repair" function and it has not worked.
    msg305647 — (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-06 15:45
    The curses module is not supported on Windows.
    msg305648 — (view) Author: Paul Moore (paul.moore) * (Python committer) Date: 2017-11-06 16:00
    The docs for the curses module say "While curses is most widely used in the Unix environment, versions are available for Windows, DOS, and possibly other systems as well." This is the only mention of platform support I can see.
    
    It might be worth making the platform support explicit in the docs.
    msg305654 — (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2017-11-06 16:42
    Curses is available for Windows from Christopher Gohlke's site: https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses
    
    We should clean up this situation, though, either by making the state of Windows curses support explicit in the docs or by actually adding support for it in the default distribution.
    msg305656 — (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-06 16:52
    There are two open issues for adding support of the curses module on Windows: issue1005895 and issue2889.
    msg305790 — (view) Author: joe m (joe m2) Date: 2017-11-07 20:17
    I would much prefer the curses module to be supported in newer versions  since I believe that curses is installed as a built in module (not sure about that).
    
    Anyhow, thank you for your help but I have found a replacement module called "asciimatics" which for fills all the functions that I really need.
    History
    Date User Action Args
    2022-04-11 14:58:54 admin set github: 76132
    2021-01-06 09:45:38 serhiy.storchaka set status: open -> closed
    superseder: curses for win32
    resolution: duplicate
    stage: resolved
    2017-11-07 20:17:14 joe m2 set messages:
    + msg305790
    2017-11-06 16:52:39 serhiy.storchaka set nosy:
    + serhiy.storchaka
    messages:
    + msg305656
    2017-11-06 16:42:15 zach.ware set messages:
    + msg305654
    2017-11-06 16:00:05 paul.moore set messages:
    + msg305648
    2017-11-06 15:45:59 vstinner set nosy:
    + vstinner
    messages:
    + msg305647
    2017-11-05 22:55:53 joe m2 create

    ModuleNotFoundError: No module named ‘_curses

    1. Сначала скачайте whl файл проклятий.

    https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses

    щелкните эту ссылку



    2. Поместите загруженный файл whl в путь Scripts каталога установки python, например, мой каталог: C: Python Python37 Scripts

    Имя загруженного файла: curses-2.2 + utf8-cp37-cp37m-win_amd64.whl.

    3. Откройте окно cmd окон и перейдите по пути C: Python Python37 Scripts

    Вы также можете установить библиотеку wheel, выполнив сначала команду pip install wheel

    3.1 выполнить команду

    pip install curses-2.2+utf8-cp37-cp37m-win_amd64.whl

    3.2. Запрашивать об успешном выполнении

    Installing collected packages: curses

    Successfully installed curses-2.2+utf8

    3.3. Если во время установки появляется сообщение об ошибке: curses-2.2 + utf8-cp37-cp37m-win_amd64.whl не поддерживается на этой платформе.

    означает, что загруженный вами файл whl не подходит для вашей текущей среды, просто скачайте и установите другие файлы whl один за другим.

    В Python может быть несколько причин возникновения ошибки ModuleNotFoundError: No module named ...:

    • Модуль Python не установлен.
    • Есть конфликт в названиях пакета и модуля.
    • Есть конфликт зависимости модулей Python.

    Рассмотрим варианты их решения.

    Модуль не установлен

    В первую очередь нужно проверить, установлен ли модуль. Для использования модуля в программе его нужно установить. Например, если попробовать использовать numpy без установки с помощью pip install будет следующая ошибка:

    Traceback (most recent call last):
       File "", line 1, in 
     ModuleNotFoundError: No module named 'numpy'

    Для установки нужного модуля используйте следующую команду:

    pip install numpy
    # или
    pip3 install numpy

    Или вот эту если используете Anaconda:

    conda install numpy

    Учтите, что может быть несколько экземпляров Python (или виртуальных сред) в системе. Модуль нужно устанавливать в определенный экземпляр.

    Конфликт имен библиотеки и модуля

    Еще одна причина ошибки No module named — конфликт в названиях пакета и модуля. Предположим, есть следующая структура проекта Python:

    demo-project
     └───utils
             __init__.py
             string_utils.py
             utils.py

    Если использовать следующую инструкцию импорта файла utils.py, то Python вернет ошибку ModuleNotFoundError.


    >>> import utils.string_utils
    Traceback (most recent call last):
    File "C:demo-projectutilsutils.py", line 1, in
    import utils.string_utils
    ModuleNotFoundError: No module named 'utils.string_utils';
    'utils' is not a package

    В сообщении об ошибке сказано, что «utils is not a package». utils — это имя пакета, но это также и имя модуля. Это приводит к конфликту, когда имя модуля перекрывает имя пакета/библиотеки. Для его разрешения нужно переименовать файл utils.py.

    Иногда может существовать конфликт модулей Python, который и приводит к ошибке No module named.

    Следующее сообщение явно указывает, что _numpy_compat.py в библиотеке scipy пытается импортировать модуль numpy.testing.nosetester.

    Traceback (most recent call last):
       File "C:demo-projectvenv
    Libsite-packages
             scipy_lib_numpy_compat.py", line 10, in
         from numpy.testing.nosetester import import_nose
     ModuleNotFoundError: No module named 'numpy.testing.nosetester'

    Ошибка ModuleNotFoundError возникает из-за того, что модуль numpy.testing.nosetester удален из библиотеки в версии 1.18. Для решения этой проблемы нужно обновить numpy и scipy до последних версий.

    pip install numpy --upgrade
    pip install scipy --upgrade 

    Понравилась статья? Поделить с друзьями:
  • Modern combat 5 читы windows 10
  • Modern combat 4 скачать на windows
  • Modemlogs что это за папка windows 7
  • Modem yota 4g lte драйвера windows 10
  • Modem setup host windows 10 грузит процессор