设置Python 101¶
首先,我们将设置一个 虚拟环境 使用 venv
Python的模块。
$ python3 -m venv ~/.virtualenvs/python101
虚拟环境可以通过以下方式激活
$ source ~/.virtualenvs/python101/bin/activate
如果一切正常,您应该看到shell提示符现在以 (python101)
。这意味着您现在对Python执行的所有操作都使用以下内容 虚拟环境 。
要确保安装其他Python包所需的Python包是最新的,请执行以下命令:
$ pip install --upgrade pip setuptools
现在我们将克隆 Python 101 存储库使用 git.
$ git clone https://github.com/ZeeD26/python101.git
我们进入新创建的目录
$ cd python101
和 install Python 101及其依赖项
$ python -m pip install -e .
注意
这个 .
之后 python -m pip install -e
很重要! python -m pip install -e
是不够的。