我在为ncurses
安装Python3
时遇到问题。当我执行正常的sudo apt-get install ncurses-dev
时,它似乎已安装在Python2
上,但是当我尝试为Python3
运行脚本时,它说。
ImportError: No module named curses
您将如何使ncurses
成为Python3
?
我有同样的问题。问题是在我的Ubuntu安装中未安装ncurses。要解决它,我跑了:
sudo apt-get install libncurses-dev
然后重新安装Python。就我而言:
pyenv install 3.8.1
被询问时回答是否继续安装? (y / N)
此问题已解决。
尝试一下:
import curses
curses是ncurses。它也内置在python中,没有任何安装。
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-65-generic x86_64)
* Documentation: https://help.ubuntu.com/
Last login: Mon Oct 19 19:06:03 2015 from xxx.xxx.xxx.xxx
me@ubuntu:~$ python3
Python 3.4.0 (default, Jun 19 2015, 14:20:21)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
>>>