This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Jupyter Lab Terminals not available (error was No module named 'winpty.cywinpty')
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: shakir_juolay, terry.reedy, xtreak
Priority: normal Keywords:

Created on 2020-11-06 09:46 by shakir_juolay, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg380443 - (view) Author: (shakir_juolay) Date: 2020-11-06 09:46
I get the below message when I run Jupyter Lab

D:\Users\sjuolay>jupyter lab
[W 12:37:50.862 LabApp] Terminals not available (error was No module named 'winpty.cywinpty')
[I 12:37:51.170 LabApp] JupyterLab extension loaded from d:\users\sjuolay\documents\python\python39\lib\site-packages\jupyterlab
[I 12:37:51.171 LabApp] JupyterLab application directory is d:\users\sjuolay\documents\python\python39\share\jupyter\lab
[I 12:37:51.300 LabApp] Serving notebooks from local directory: D:\Users\sjuolay
[I 12:37:51.301 LabApp] Jupyter Notebook 6.1.4 is running at:
[I 12:37:51.301 LabApp] http://localhost:8888/?token=9a64c8f9a15b970ecc775090c4e5b8c90677f1456a83a932
[I 12:37:51.301 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 12:37:51.330 LabApp]

    To access the notebook, open this file in a browser:
    Or copy and paste one of these URLs:
[I 12:37:53.917 LabApp] Build is up to date

And when I run the below from Python IDLE I get

>>> import winpty
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import winpty
  File "D:\Users\sjuolay\Documents\Python\Python39\lib\site-packages\winpty\", line 11, in <module>
    from .ptyprocess import PtyProcess
  File "D:\Users\sjuolay\Documents\Python\Python39\lib\site-packages\winpty\", line 21, in <module>
    from .winpty_wrapper import PTY, PY2
  File "D:\Users\sjuolay\Documents\Python\Python39\lib\site-packages\winpty\", line 12, in <module>
    from .cywinpty import Agent
ModuleNotFoundError: No module named 'winpty.cywinpty'

Software Details
Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32
Jupyter Lab 2.2.9
pywinpty 0.5.7

Any idea how much of an impact the error has on Jupyter Lab, since it is launched in browser? How to fix this?
msg380444 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2020-11-06 10:03
The tracker is for issues related to CPython and doesn't seem to be caused due to python itself. I would suggest following it up on jupyterlab's issue tracker and forums.
msg380475 - (view) Author: (shakir_juolay) Date: 2020-11-06 20:33
I do not think the issue is related to Jupyter since even import winpty in Python IDLE is giving the same error.

I resolved the issue by doing the following but I do not know which of them is the main culprit.

1. Downgraded to Python 3.8.5 (pywinpty currently does not have cp39 version wheel file)

2. pip install wheel (since when I trying to pip install pywinpty in Python 3.9.0 I was getting the message package 'wheel' is not installed using instead, and as I understand .whl files are better options for installation, and some folks on Google have resolved this issue using manual wheel files from Christoph Gohlke's PythonLibs)

3. pip install jupyterlab (I noticed pywinpty was installed using .whl file)
msg380500 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-11-07 10:32
The 'culprit' is that many 3rd party packages have not yet released 'official' wheels.  This is unfortunately typical this soon after a new version is released.  We are hoping that predictable yearly releases will improve the situation.  We will have to wait and see yet.
Date User Action Args
2022-04-11 14:59:37adminsetgithub: 86441
2020-11-07 10:32:39terry.reedysetresolution: fixed -> not a bug

messages: + msg380500
nosy: + terry.reedy
2020-11-06 20:33:38shakir_juolaysetstatus: open -> closed
resolution: fixed
messages: + msg380475

stage: resolved
2020-11-06 10:03:33xtreaksetnosy: + xtreak
messages: + msg380444
2020-11-06 09:46:37shakir_juolaycreate