简体   繁体   English

Python 3.7 Windows 不支持 dbm.gnu 吗?

[英]Is dbm.gnu not supported on Python 3.7 Windows?

When doing做的时候

import dbm.gnu

on a standard Python 3.7.6 (64) for Windows, I get:在适用于 Windows 的标准 Python 3.7.6 (64) 上,我得到:

File "C:\\Python37\\lib\\dbm\\gnu.py", line 3, in文件“C:\\Python37\\lib\\dbm\\gnu.py”,第 3 行,在
from _gdbm import *从 _gdbm 导入 *
ModuleNotFoundError: No module named '_gdbm' ModuleNotFoundError: 没有名为“_gdbm”的模块

Isn't dbm.gnu supported out of the box on Windows? dbm.gnu在 Windows 上不支持开箱即用吗?


  • The same problem happens with:同样的问题发生在:

     import dbm.ndbm

    File "C:\\Python37\\lib\\dbm\\ndbm.py", line 3, in文件“C:\\Python37\\lib\\dbm\\ndbm.py”,第 3 行,在
    from _dbm import *从 _dbm 导入 *
    ModuleNotFoundError: No module named '_dbm' ModuleNotFoundError: 没有名为“_dbm”的模块

  • I tested on another Python 3.6.8, and it's the same.我在另一个 Python 3.6.8 上测试过,结果是一样的。

This has always been the case (that gdbm and ndbm are not supported on windows).情况一直如此(Windows 不支持 gdbm 和 ndbm)。 See also issue 3769 for background and dbm and windows, and issue 3783 for something to work on if you want to contribute to making the dbm story on windows better.另请参阅问题 3769了解背景、dbm 和窗口,以及问题 3783了解一些工作,如果您想为 Windows 上的 dbm 故事做出更好的贡献。

Googling found a gdbm port to windows, so if you are trying to use source files from linux, that might help you.谷歌搜索找到了一个 gdbm 端口到 Windows,所以如果您尝试使用来自 linux 的源文件,这可能对您有所帮助。 We're open to suggestions on improving the situation here, but someone has to figure out what would make sense and champion it.我们乐于接受改善这里情况的建议,但必须有人弄清楚什么是有意义的并支持它。 Bundling the gdbm windows port is probably not an option, but making it possible to install something via PIP that will work is, if there's anything in core preventing that currently.捆绑 gdbm windows 端口可能不是一种选择,但是如果当前核心中有任何阻止的话,可以通过 PIP 安装一些可以工作的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM