Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytorch cannot be installed under Windows 10 if Python 3.7 was installed from Microsoft Store #23823

Open
JonasHeidelberg opened this issue Aug 5, 2019 · 2 comments

Comments

@JonasHeidelberg
Copy link

commented Aug 5, 2019

Issue description

pytorch 1.1.0 cannot be installed under Windows 10 if Python 3.7 was installed from Microsoft Store.

The reason is a combination of
a) long Python installation path used by Microsoft Store installer
b) long filename path used within pytorch for collect_and_distribute_fpn_rpn_proposals_op_test.test_collect_and_dist.zip
c) by default, Windows 10 still refuses paths longer than 256 characters

Code example

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'

The error is caused by the 256 character limit on Windows paths. With a file and pathname so long, no matter how short is the path is 257 characters or longer.

System Info

PyTorch version: 1.1.0
OS: Microsoft Windows 10 Pro, Version 1903
Python version: 3.7

Versions of relevant libraries:
[pip3] numpy==1.17.0
[pip3] torch==1.1.0
[pip3] torchvision==0.3.0

@JonasHeidelberg

This comment has been minimized.

Copy link
Author

commented Aug 5, 2019

I am not the first or only one to have this problem, see https://www.reddit.com/r/pytorch/comments/c6cllq/issue_installing_pytorch/ .
A workaround is to tell Windows to accept long paths, see here. However, this requires people to search for the error message online and find this. A more convenient solution implementable in pytorch could be to simply rename the collect_and_distribute_fpn_rpn_proposals_op_test.py file to something shorter? I know this only reduces the problem a little, since users with long usernames can still run into such a problem.

A more clean solution would be to have whichever tool fails to unpack that file throw a more meaningful error. Just some thoughts...

@ailzhang ailzhang added the triaged label Aug 7, 2019

@iofu728

This comment has been minimized.

Copy link

commented Sep 2, 2019

This problem also occurs in my Windows OS 18965.1005.

And I fix this bug refers to upper link reddit.com/r/pytorch/comments/c6cllq/issue_installing_pytorch/ew27hih/?utm_source=share&utm_medium=web2x.

The problem is caused by the Long Path Name of collect_and_distribute_fpn_rpn_proposals_op_test.test_collect_and_dist.zip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.