导入rlcompleter时python暂停

时间:2018-07-23 11:07:26

标签: python-3.x crash python-import readline freeze

我在Anaconda中安装了python 3.6.4。我的问题是,如果我尝试启动python.exe,它会死机,它会使CPU超载,并开始分配大量RAM,而没有响应。但是:

  • 如果我使用-I开关启动它,那就没问题(将Python与用户环境隔离(意味着-E和-s))。

  • 如果我以-S开头,就可以了(不要在初始化时暗示“导入站点”)

  • 如果我启动IPython,那就可以了(python.exe C:\ Anaconda3 \ cwp.py C:\ Anaconda3“ C:/Anaconda3/python.exe”“ C:/ Anaconda3 / Scripts / ipython -script.py“)

  • 如果我启动任何模块,那就没关系(例如python.exe -m http.server)

我试图以-v swhitch(详细)开始,看来挂起的是以下内容:

# c:\Anaconda3\lib\site-packages\pyreadline\console\__pycache__\event.cpython-36.pyc matches c:\Anaconda3\lib\site-packages\pyreadline\console\event.py
# code object from 'c:\\Anaconda3\\lib\\site-packages\\pyreadline\\console\\__pycache__\\event.cpython-36.pyc'
import 'pyreadline.console.event' # <_frozen_importlib_external.SourceFileLoader object at 0x0000000002D5F9B0>
import 'pyreadline.console.console' # <_frozen_importlib_external.SourceFileLoader object at 0x0000000002D4B7B8>
import 'pyreadline.console' # <_frozen_importlib_external.SourceFileLoader object at 0x0000000002D4B668>
# c:\Anaconda3\lib\site-packages\pyreadline\__pycache__\rlmain.cpython-36.pyc matches c:\Anaconda3\lib\site-packages\pyreadline\rlmain.py
# code object from 'c:\\Anaconda3\\lib\\site-packages\\pyreadline\\__pycache__\\rlmain.cpython-36.pyc'
# c:\Anaconda3\lib\site-packages\pyreadline\__pycache__\release.cpython-36.pyc matches c:\Anaconda3\lib\site-packages\pyreadline\release.py
# code object from 'c:\\Anaconda3\\lib\\site-packages\\pyreadline\\__pycache__\\release.cpython-36.pyc'
import 'pyreadline.release' # <_frozen_importlib_external.SourceFileLoader object at 0x0000000002DD5D30>
import 'pyreadline.rlmain' # <_frozen_importlib_external.SourceFileLoader object at 0x0000000002AC4DA0>
import 'pyreadline' # <_frozen_importlib_external.SourceFileLoader object at 0x000000000296B550>
import 'readline' # <_frozen_importlib_external.SourceFileLoader object at 0x0000000002954630>
# c:\Anaconda3\lib\__pycache__\rlcompleter.cpython-36.pyc matches c:\Anaconda3\lib\rlcompleter.py
# code object from 'c:\\Anaconda3\\lib\\__pycache__\\rlcompleter.cpython-36.pyc'
import 'rlcompleter' # <_frozen_importlib_external.SourceFileLoader object at 0x0000000002E04E10>

如果我尝试从工作的IPython控制台导入rlcompleter模块,则它可以正常工作。怎么了?我如何找到问题?感谢您的提示!

0 个答案:

没有答案