问题
I am trying to install pip by python get-pip.py
command on my python3.6 virtualenv but i get the error:
(myvenv_python3) C:\Users\Kaleab\Downloads>python get-pip.py --trusted-host=pypi
.org
Collecting pip
Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b
44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)
Could not install packages due to an EnvironmentError: [WinError 31] A device at
tached to the system is not functioning
Consider using the `--user` option or check the permissions.
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-
8'>
PermissionError: [WinError 31] A device attached to the system is not functionin
g
(myvenv_python3) C:\Users\Kaleab\Downloads>
What solution would you recommend? I am using Windows 8.1 machine.
回答1:
I am on Windows 7. I came across the same bug. I read the discussion here. It seems to be caused by UTF-8 support if you have English Windows.
Just type:
chcp 1252
then run your pip again.
回答2:
The reason for the PermissionError was because i changed registry code page to 65001:
REG ADD HKCU\Console /v CodePage /t REG_DWORD /d 65001 /f
So, remove the autorun registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor. If you want to use utf-8 ( 65001) just use chcp 65001
on command prompt.
来源:https://stackoverflow.com/questions/50085366/permissionerror-winerror-31-a-device-attached-to-the-system-is-not-functioning