根据 pipenv official documentation :
sync
pipenv sync [OPTIONS]
Installs all packages specified in Pipfile.lock.
install
pipenv install [OPTIONS] [PACKAGES]...
Installs provided packages and adds them to Pipfile, or (if no packages are given), installs all packages from Pipfile.
--ignore-pipfile Ignore Pipfile when installing, using the Pipfile.lock.
可以安全地假设 pipenv sync
和 pipenv install --ignore-pipfile
是相同的,没有任何隐藏的缺 pip 吗?
更多背景:我使用 --system 标志将 python 包安装到系统,因为我不关心 docker 容器中的隔离环境。但是 --system 标志对于 pipenv sync
不可用(参见 github issue ),所以我认为 pipenv install --system --ignore-pipfile
可能是一个可行的 hack。
最佳答案
可以看到Advanced usage of pipenv中的注释
pipenv install --ignore-pipfile
is nearly equivalent topipenv sync
, butpipenv sync
will never attempt to re-lock your dependencies as it is considered an atomic operation.pipenv install
by default does attempt to re-lock unless using the--deploy
flag.
所以也许 pipenv install --ignore-pipfile --deploy
等于 pipenv sync
关于python - docker环境下pipenv sync和pipenv install --system --ignore-pipfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52922688/