Ben Alan
Ben Alan

Reputation: 1695

Where is curses in python 3.9.5?

I just updated from 3.6 and curses is nowhere to be found in pip list. When I try to run my program I get

Traceback (most recent call last):
  File "/media/HD/Documents/Python/program/menu.py", line 1, in <module>
    import curses
  File "/usr/local/lib/python3.9/curses/__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'

"pip3 install curses" gives me

ERROR: Could not find a version that satisfies the requirement curses (from versions: none)
ERROR: No matching distribution found for curses

Any ideas? Does python not come with curses anymore?

Edit: This is in Ubuntu

Upvotes: 4

Views: 3477

Answers (4)

gerardw
gerardw

Reputation: 6329

curses is part of the stdlib. It should be installed by default when you install a Python3 version on Linux https://docs.python.org/3/library/curses.html

Upvotes: 0

EdwardFunnyHands
EdwardFunnyHands

Reputation: 153

I solved this issue by using below command. It adds support for the standard Python curses module on Windows. Read more about it here.

pip install windows-curses

Upvotes: 2

Ben Alan
Ben Alan

Reputation: 1695

I solved this problem by using an earlier version of python (3.6.9)

Sadly, this is probably the only solution.

Upvotes: 0

PApostol
PApostol

Reputation: 2302

For Linux, you need to install UniCurses which is OS-independent. Note that UniCurses hasn't need maintained in a while, but you could find some more information on it here.

Upvotes: 0

Related Questions