小伙伴们在使用 pipenv lock 命令是总感觉太慢,现在你只需要加一个参数即可加速 lock
pipenv lock --pypi-mirror https://pypi.tuna.tsinghua.edu.cn/simple
如果 lock 的时候出现 timeout 错误,可以尝试设置环境变量 PIP_DEFAULT_TIMEOUT=300,默认是 60
平常安装依赖包的时候可以使用 --skip-lock
先跳过 locking 过程,在提交和部署时再统一进行 lock
pipenv install requests --skip-lock
$ pipenv lock --help
Usage: pipenv lock [OPTIONS]
Generates Pipfile.lock.
Options:
-r, --requirements Generate output in requirements.txt format.
--keep-outdated Keep out-dated dependencies from being updated in
Pipfile.lock. [env var: PIPENV_KEEP_OUTDATED]
--pre Allow pre-releases.
-d, --dev Install both develop and default packages. [env var:
PIPENV_DEV]
--python TEXT Specify which version of Python virtualenv should use.
--three / --two Use Python 3/2 when creating virtualenv.
--clear Clears caches (pipenv, pip, and pip-tools). [env var:
PIPENV_CLEAR]
-v, --verbose Verbose mode.
--pypi-mirror TEXT Specify a PyPI mirror.
-h, --help Show this message and exit.