Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
failure to find modules
#1
Hello,

I am quite new to Python and this is my first time using modules. Every time I try to import a module I get the error: ModuleNotFoundError: No module named '_curses'.
When using the commandprompt with py -m pip install curses, I get the message that it is allready installed and I get the path to the installed module. I still got the error message. Then I added the path to PYTHONPATH, still the same error. Then I added it to sys.path, but still the same error. Can anyone please help me with some information on how to correctly make use of the module?

Greetings,

Justus
Reply
#2
Why is there an underscore before curses? Your code should be import curses. How are you changing sys.path if you can't import sys? Please show the exact code you are using to import, in python tags (see the BBCode link below) and the full text of the error message you are getting.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
(Dec-14-2018, 03:04 PM)ichabod801 Wrote: Why is there an underscore before curses?
The first line of the curses module imports _curses: https://github.com/python/cpython/blob/m...t__.py#L13
Quote:
"""curses
The main package for curses support for Python.  Normally used by importing
the package, and perhaps a particular module inside it.
   import curses
   from curses import textpad
   curses.initscr()
   ...
"""

from _curses import *

curses is a builtin module, there's nothing to install. _curses, which actually does most of the work, is a c extension module, that's built into python. If you're on windows, then you'll need to install the third party windows-curses, as the builtin curses package only works on unix systems (...since curses is a unix program that doesn't work on windows lol).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Failure to run source command middlestudent 2 689 Sep-22-2023, 01:21 PM
Last Post: buran
  Dickey Fuller failure Led_Zeppelin 4 2,606 Sep-15-2022, 09:07 PM
Last Post: Led_Zeppelin
  Assert failure jtcostel 1 1,635 Sep-03-2021, 05:28 PM
Last Post: buran
  xml decoding failure(bs4) roughstroke 1 2,253 May-09-2020, 04:37 PM
Last Post: snippsat
  SCIKIT learn failure in mac Perja11 1 2,290 Nov-30-2019, 06:44 PM
Last Post: snippsat
  Beginner Q: failure to find string in list Jenny 2 2,708 Mar-18-2018, 01:07 PM
Last Post: Jenny
  LIB install failure Able98 2 3,907 Jun-07-2017, 06:41 PM
Last Post: Able98
  Modules issue, pip3 download modules only to pyhton3.5.2 not the latest 3.6.1 bmohanraj91 6 8,426 May-25-2017, 08:15 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020