列表中的模块无法导入(Module in list can't be imported)

编程入门 行业动态 更新时间:2024-10-19 23:38:12
列表中的模块无法导入(Module in list can't be imported)

我知道这可以标记为重复,但请听我说! 像这样的问题已经过时了,不再适用于我的需求!

我使用help("Modules")来获取所有已安装模块的列表。 我正在寻找的模块, "crypt"在列表中。 当我尝试在shell和新文件中导入它时,我收到以下错误:

Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> import crypt File "C:\Users\Work\AppData\Local\Programs\Python\Python35-32\lib\crypt.py", line 3, in <module> import _crypt ImportError: No module named '_crypt'

注意 :我没有使用下划线调用它

I know that this could be marked as a duplicate, but hear me out! The questions like this one are horribly out of date and no longer apply to my needs!

I used help("Modules")to get a list of all installed modules. The module I was looking for, "crypt" was in the list. When I tried to import it in the shell and in a new file, I got the following error:

Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> import crypt File "C:\Users\Work\AppData\Local\Programs\Python\Python35-32\lib\crypt.py", line 3, in <module> import _crypt ImportError: No module named '_crypt'

Note: I did not call it with an underscore

最满意答案

看起来你正试图在Windows上运行它 - crypt是一个只有Unix的库。

https://docs.python.org/dev/library/crypt.html

It looks like you are trying to run it on Windows -- crypt is a Unix-only library.

https://docs.python.org/dev/library/crypt.html

更多推荐

本文发布于:2023-08-01 11:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1357982.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模块   列表中   Module   list   imported

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!