# 2.7
easy_install pip
# 3.6
curl https://bootstrap.pypa.io/pip/3.6/get-pip.py | python3.6
# 3.6以上
curl https://bootstrap.pypa.io/get-pip.py | python3.10
pip install virtualenv
pip install virtualenvwrapper
export WORKON_HOME=/Users/jtserver/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
export PIP_VIRTUALENV_BASE=/Users/jtserver/.virtualenvs
export PATH="/usr/local/sbin:$PATH"
pip install virtualenv -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com/simple
Python 2.7升级pip报错:def read(rel_path: str) -> str:SyntaxError: invalid syntax
setuptools版本太低升级
卸载setuptools,不能重新安装
升级pip到20.3.4,安装虚拟环境又显示python2.7只维护到2020,给跪了,还是安装python3版本的pip
pip3 install virtualenv
pip3 install virtualenvwrapper
sudo ln -sv /Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenvwrapper.sh /usr/local/bin/
export VIRTUALENVWRAPPER_PYTHON='/Library/Frameworks/Python.framework/Versions/3.6/bin/python3'
export WORKON_HOME=/Users/jtserver/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
export PIP_VIRTUALENV_BASE=/Users/jtserver/.virtualenvs
export PATH="/usr/local/sbin:$PATH"
mkdir ~/.pip
echo '
[install]
use-mirrors = true
mirrors = http://b.pypi.python.org
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
trusted-host=mirrors.aliyun.com
# 豆瓣源
# index-url = http://pypi.douban.com/simple/
# trusted-host = pypi.douban.com
' >> ~/.pip/pip.conf