Pip install sometimes fails on windows systems with 260 character path limit
Issue Summary
pip install will sometimes fail on windows due to long paths, if the path limit is not disabled. Due to a combination of long paths in a CI build or long paths for e.g. the Windows store version of python and long paths in the package, the installer may attempt create files with a path over 260 characters and fail. I think this was one of the issues encountered by the reporter in #510
Steps to Reproduce
Installing on windows 10, python 3.6, pip 20.2, 6.44.1 without character path limit disabled.
pip install twilio
Code Snippet
# paste code here
Exception/Log
byte-compiling c:\users\administrator\desktop\builds\ercp-8uu\0\xxxxxxxxxxxxxxxxxxx\yyyyyyyyyyyyyyyyy\env\Lib\site-packages\twilio\rest\api\v2010\account\sip\domain\auth_types\auth_registrations_mapping\auth_registrations_credential_list_mapping.py to auth_registrations_credential_list_mapping.cpython-36.pyc
error: [Errno 2] No such file or directory: 'c:\\users\\administrator\\desktop\\builds\\ercp-8uu\\0\\xxxxxxxxxxxxxxxxxxx\\yyyyyyyyyyyyyyyyy\\env\\Lib\\site-packages\\twilio\\rest\\api\\v2010\\account\\sip\\domain\\auth_types\\auth_registrations_mapping\\__pycache__\\auth_registrations_credential_list_mapping.cpython-36.pyc.50728064'
Technical details:
- twilio-python version:
- python version:
Workaround
Disabling the path limit in Windows or using an install location in a shorter path resolves the issue, however, it would be at least worth a better error message in this case.
I think this is a good candidate to add to the install docs.
This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.
can I work on it?
I just ran into this issue. For those looking for a fix here's what I did.
1.In Registry Editor navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
-
Find - LongPathsEnabled dword
-
Change Value to 1 1 = Enable