10000 DOC Instructions to troubleshoot Windows path length limit (#15916) · ogrisel/scikit-learn@ce49cb4 · GitHub
[go: up one dir, main page]

Skip to content

Commit ce49cb4

Browse files
committed
DOC Instructions to troubleshoot Windows path length limit (scikit-learn#15916)
1 parent 098cd3a commit ce49cb4

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

doc/install.rst

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ If you have not installed NumPy or SciPy yet, you can also install these using
126126
conda or pip. When using pip, please ensure that *binary wheels* are used,
127127
and NumPy and SciPy are not recompiled from source, which can happen when using
128128
particular configurations of operating system and hardware (such as Linux on
129-
a Raspberry Pi).
129+
a Raspberry Pi).
130130

131131
If you must install scikit-learn and its dependencies with pip, you can install
132132
it as ``scikit-learn[alldeps]``.
@@ -255,3 +255,38 @@ WinPython for Windows
255255

256256
The `WinPython <https://winpython.github.io/>`_ project distributes
257257
scikit-learn as an additional plugin.
258+
259+
260+
Troubleshooting
261+
===============
262+
263+
.. _windows_longpath:
264+
265+
Error caused by file path length limit on Windows
266+
-------------------------------------------------
267+
268+
It can happen that pip fails to install packages when reaching the default path
269+
size limit of Windows if Python is installed in a nested location such as the
270+
`AppData` folder structure under the user home directory, for instance::
271+
272+
C:\Users\username>C:\Users\username\AppData\Local\Microsoft\WindowsApps\python.exe -m pip install scikit-learn
273+
Collecting scikit-learn
274+
...
275+
Installing collected packages: scikit-learn
276+
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\sklearn\\datasets\\tests\\data\\openml\\292\\api-v1-json-data-list-data_name-australian-limit-2-data_version-1-status-deactivated.json.gz'
277+
278+
In this case it is possible to lift that limit in the Windows registry by
279+
using the ``regedit`` tool:
280+
281+
#. Type "regedit" in the Windows start menu to launch ``regedit``.
282+
283+
#. Go to the
284+
``Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem``
285+
key.
286+
287+
#. Edit the value of the ``LongPathsEnabled`` property of that key and set
288+
it to 1.
289+
290+
#. Reinstall scikit-learn (ignoring the previous broken installation)::
291+
292+
pip install --exists-action=i scikit-learn

0 commit comments

Comments
 (0)
0