Steve Dower <steve.do...@python.org> added the comment:

Short of adding a popup into Python itself the first time you run it (and would 
that include if you run "pip" first?), we don't have any ability to extend the 
installer.

We could reduce the "local-packages/Python37/site-packages" part of the path by 
implementing an alternative way (in both Python and pip, presumably) to specify 
the user's site packages. Right now, the best I can do is reduce 
"local-packages" down to a single character (in PC/python_uwp.cpp ) - the rest 
is forcibly added by the shared part of the runtime.

Since pip is likely to be the first place users hit this, it might be easiest 
to start by adding a more descriptive error message. Copying from the other bug:

pip3 install 
https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-win_amd64.whl
fails with an error message:

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\\caffe2\\python\\serialized_test\\data\\operator_test\\collect_and_distribute_fpn_rpn_proposals_op_test.test_collect_and_dist.zip'

First it seems the error is being raised incorrectly - winerror 2 is for file 
not found, but it's being passed as errno 2. But otherwise it should be 
possible to detect this case, see that the path is too long on Windows and 
point users at 
https://docs.python.org/3/using/windows.html#removing-the-max-path-limitation

----------
nosy: +Marcus.Smith, dstufft, ncoghlan, pradyunsg

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37769>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to