20

I'm trying to install Jupyter on Python 3.7 and seem to be stumbling over this error again and again;

winpty/cywinpty.c(598): fatal error C1083: Cannot open include file: 'winpty.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

I get the same error when attempting to install pywinpty via pip.

I have installed & reinstalled the build tools to no avail and the command window is elevated - any ideas?

UPDATE: Not quite resolved in 3.7 - but it worked fine in 3.6, I've rolled back.

Giulio Caccin
  • 2,962
  • 6
  • 36
  • 57
C-Sway
  • 357
  • 1
  • 2
  • 13

4 Answers4

42

Temporarily, until standard way does not work for Python 3.7, you can install pywinpty manually by using the prebuilt wheel from Gohlke's collection and then install jupyter with pip.

To install manually (from cmd or Powershell) use: pip install drive:\path\to\the\wheel\pywinpty-0.5.4-cp37-cp37m-win_amd64.whl

godaygo
  • 2,215
  • 2
  • 16
  • 33
  • 5
    Annoying that this product is used so widely among everyone, including windows users. And in 2020 this is still an issue that most beginners following guides and recommendations will bump in to and most likely struggle with. – Torxed Oct 06 '20 at 13:20
  • 3
    There's an easier way to install from Gohlke's collection, which is to use `pipwin`. Install `pipwin` using `pip install pipwin` and then use it in place of `pip` whenever something doesn't work. – Param Siddharth Oct 14 '20 at 03:28
  • 1
    Dear @ParamSiddharth it was a good substitute answer – Peyman Majidi Feb 20 '21 at 08:24
  • 1
    I hit this issue with trying to install Jupyterlab and the only way around it was manually installing the prebuilt wheel. Thanks a lot for your answer! – Joseph Honeywood Mar 26 '21 at 17:40
  • the problem persisted until 2022 and this is still the valid solution in 2022 – Jansen Simanullang Oct 25 '22 at 08:50
5

I've a concrete solution for you guys... I'm also facing the same issue like you guys as it arises with python3.7 or later versions... But don't worry

I currently have Python 3.9.2

ERROR : image

Follow these Steps:-

--> Write these Commands in the cmd

  1. Just install pywinpty by using Gholke s Collection
  2. Now, just download it Pywinpty link
  3. Now, copy the path of the file, from where you have downloaded it... In my case it is file address
  4. After successfully installed Pywinpty... now "pip install jupyter"
  5. Then it's DONE... Now launch the notebook using "jupyter notebook"

In case its not been done... Make a comment below...

DaveL17
  • 1,673
  • 7
  • 24
  • 38
Sahil Kumar
  • 53
  • 1
  • 3
4

There's an easier way to install from Gohlke's collection, which is to use pipwin. Install pipwin using pip install pipwin and then use it in place of pip whenever something doesn't work.

Param Siddharth
  • 858
  • 2
  • 7
  • 20
2

I will leave this option here too. You can install the pywinpty 0.5.7 induvidually and then the rest of the installation can continue.

python -m pip install pywinpty==0.5.7

It worked for me.

MEdwin
  • 2,940
  • 1
  • 14
  • 27