No module named _curses problem when using Python's Curses library under Windows

solve

First of all, the root is that the curses library does not support windows . So after we download python (python has its own curses library), although we can see the curses library in the   python directory \Lib  , we can't actually use it. will produce the above error. The sentence from _curses import *  can indeed be found  in the prompt file __init__ file.

To solve this problem, we need to use an unofficial curses (unofficial curses library) instead of the curses library that comes with python. That is, the whl package.

Using my own example, I downloaded the python3.6.4 version, found curses in https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses, and then downloaded the whl package corresponding to my python version ( For example, mine is curses-2.2-cp36-cp36m-win32.whl), I am windows10-64bit, I began to think that I need to download the amd64 version. After testing, it was found that when using that version, it will report an environment that is not supported during installation. Wrong, after replacing this it is correct.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324684470&siteId=291194637