“itertools”模块没有属性“\uuu file”

2024-05-18 12:04:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用itertools模块,但我不确定它是否已启动并正在运行。我在/usr/lib/python*中找不到任何内容。(2.7和3.5在我的系统和一些VirtualEnv下都可用)。关于这个我没有发现重复的问题。在

我试过我的系统:

alexandre@Martin-2:~$ python3
Python 3.5.2 (default, Sep 14 2017, 22:51:06) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.modules['itertools']
<module 'itertools' (built-in)>
>>> import itertools
>>> itertools.__file__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'itertools' has no attribute '__file__'
>>> quit()

有什么提示吗?在


Tags: 模块inimport内容virtualenvlibusr系统