Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 OpenSUSE 上安装了 Python 2.7。我正在使用该pty模块来生成一些 pty:
pty
import pty
但是 Python 似乎找不到它。
ImportError: No module named pty
在解释器中运行help('modules')显示pty已安装。
help('modules')
转发作为答案:
问题可能是您的 IDE 设置不sys.path正确。查找pty从哪里导入,并确保它位于 IDE 设置中的 PYTHONPATH 上。
sys.path