我知道这可以标记为重复,但请听我说! 像这样的问题已经过时了,不再适用于我的需求!
我使用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
更多推荐
发布评论