简体   繁体   English

列表中的模块无法导入

[英]Module in list can't be imported

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. 我使用help("Modules")获取所有已安装模块的列表。
The module I was looking for, "crypt" was in the list. 我正在寻找的模块"crypt"已在列表中。
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 注意 :我没有用下划线来称呼它

It looks like you are trying to run it on Windows -- crypt is a Unix-only library. 看来您正在尝试在Windows上运行它-crypt是仅Unix的库。

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

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

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