加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

Windows7中Python 3.4中的curses需要什么?

发布时间:2020-12-13 20:21:32 所属栏目:Windows 来源:网络整理
导读:我的Windows 7(x64)机器上安装了一个运行的 Python 2.7 / 3.4.我想在Windows上测试诅咒. 诅咒安装但不工作: import cursesTraceback (most recent call last): File "stdin",line 1,in module File "C:ToolsPython3.4.2libcurses__init__.py",line 13,
我的Windows 7(x64)机器上安装了一个运行的 Python 2.7 / 3.4.我想在Windows上测试诅咒.

诅咒安装但不工作:

>>> import curses
Traceback (most recent call last):
  File "<stdin>",line 1,in <module>
  File "C:ToolsPython3.4.2libcurses__init__.py",line 13,in <module>
    from _curses import *
ImportError: No module named '_curses'

documentation说:

The Windows version of Python doesn’t include the 07001 module. A ported version called 07002 is available.

所以,Python 3.4的Windows安装程序安装了没有解决的依赖关系的curses.人们可以命名这个bug

好的,我看了UniCurses.这是PDCurses的封装:

UniCurses is a wrapper for Python 2.x/3.x that provides a unified set of Curses functions on all platforms (MS Windows,Linux,and Mac OS X) with syntax close to that of the original NCurses. To provide the Curses functionality on Microsoft Windows systems it wraps 07003.

通过pip3安装UniCurses会导致错误:

C:UsersPaebbels>pip3 install UniCurses
Downloading/unpacking UniCurses
  Could not find any downloads that satisfy the requirement UniCurses
  Some externally hosted files were ignored (use --allow-external UniCurses to allow).
Cleaning up...
No distributions at all found for UniCurses
Storing debug log for failure in C:UsersPaebbelspippip.log

在Python UniCurses网站上的SourceForge链接已经死了.一个手动搜索SourceForge帮助找到了UniCurses for Python.

但是,UniCurses 1.2安装程序在我的Windows注册表中找不到任何Python安装. (Python 2.7.9和Python 3.4.2可用).

我也研究了公共领域诅咒(PDCurses). PD Cureses 3.4是从2008年底开始的,所以7岁.我不相信它可以与Windows 7,Windows 8.1或Windows 10.

有什么办法可以使用Python在Windows上运行curses.

(Windows Python,而不是CygWin Python!)

您可以使用诅咒交叉平台(Windows,MacOS,GNU / Linux),如果您手动安装Windows或其他其他软件包.

1o安装车轮包装.你需要更多关于wheel click here的信息吗?

2o转到this repository.

3o用python版本下载一个包,例如python 3.4:

curses-2.2-cp34-none-win_amd64.whl

4o安装它(这个命令如果是Windows,在GNU / Linux安装像其他包)

python -m pip install curses-2.2-cp34-none-win32.whl

5o只包含在你的python脚本中:

import curses

您可以使用诅咒包装器进行python.在所有终端使用Fedora 25,Windows 10使用git bash,powershell或cmd.

更新:

> Windows here中的诅咒的替代方法.
> Windows here中的Console用户界面.
>有趣的教程here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读