在win10上安装完python后,用pip安装virtualenv慢,采用临时指定下载源进行下载会快点!
但按照过程中出现以下报错:
C:\Users\Jochen>pip install virtualenv -i https://mirrors.aliyun.com/pypi/simple
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting virtualenv
Downloading https://mirrors.aliyun.com/pypi/packages/b6/30/96a02b2287098b23b875bc8c2f58071c35d2efe84f747b64d523721dc2b5/virtualenv-16.0.0-py2.py3-none-any.whl (1.9MB)
100% |████████████████████████████████| 1.9MB 2.2MB/s
Installing collected packages: virtualenv
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'c:\\program files\\python37\\Lib\\site-packages\\virtualenv.py'
Consider using the `--user` option or check the permissions.
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
目测应该上权限问题!尝试以管理员身份运行cmd.exe,问题解决:
C:\Windows\system32>pip install virtualenv -i https://mirrors.aliyun.com/pypi/simple
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting virtualenv
Using cached https://mirrors.aliyun.com/pypi/packages/b6/30/96a02b2287098b23b875bc8c2f58071c35d2efe84f747b64d523721dc2b5/virtualenv-16.0.0-py2.py3-none-any.whl
Installing collected packages: virtualenv
The script virtualenv.exe is installed in 'c:\program files\python37\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed virtualenv-16.0.0
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
检查pip安装结果:
C:\Windows\system32>pip list virtualenv
Package Version
---------- -------
pip 10.0.1
setuptools 39.0.1
virtualenv 16.0.0
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.