Anirban B
Anirban B

Reputation: 517

OSError [Errno 2] No such file or directory while installing Jupyter Notebook in Python 3.11 on Windows 11

I am trying to install Jupyter Notebook on my Windows 11 machine using Python 3.11.4, but I encounter an OSError with the message:

[Errno 2] No such file or directory.

I have already tried different installation commands, including pip install notebook, pip install notebook --user, and python -m pip install jupyter, but none of them resolved the issue.

Error details:

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\Users\1234\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\jedi\third_party\typeshed\third_party\2and3\requests\packages\urllib3\packages\ssl_match_hostname\_implementation.pyi'

I have also referred to the following Stack Overflow links, but the solutions provided did not help me resolve the issue:

  1. Python: Could not install packages due to an OSError: [Errno 2] No such file or directory
  2. Could not install packages due to an OSError: [Errno 2] No such file or directory: '/C:/Windows/TEMP/abs_e9b7158a-aa56-4a5b-87b6-c00d295b01fanefpc8_o/

How to resolve this OSError and successfully install Jupyter Notebook on Python 3.11 running on Windows 11?

I have verified that my pip version is 23.2.1 and tried to install Jupyter Notebook using both system-wide and user-specific installation options, but the error persists.

Upvotes: 1

Views: 1510

Answers (2)

Alberto T
Alberto T

Reputation: 1

Avoid installing python from Microsoft Store. Reinstall instead the last version with the .exe from the official site

Upvotes: 0

Mukit
Mukit

Reputation: 41

The issue is likely due to the long file path limitation in Windows. I encountered the same problem and resolved it by enabling the long path support in the Windows Registry.

Here’s how you can do it:

  1. Open the Registry Editor. You can do this by typing regedit in the Run dialog (Win + R) and pressing Enter.

  2. Navigate to the following path:

    Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
    
  3. Find the entry named LongPathsEnabled.

  4. Double-click on LongPathsEnabled and change its value from 0 to 1.

  5. Click OK and close the Registry Editor.

After making this change, the long path support should be enabled, and your problem should be resolved.

Upvotes: 2

Related Questions