pipenv install每次安装依赖项/ Pycharm无法识别它们

问题描述 投票:1回答:1

我的pipenv设置存在各种问题(另一个问题是differences between users even after using Pipfile and Pipfile.lock with explicit versions),我刚注意到其他一些似乎很时髦的问题。

事实证明,在我的项目文件夹中(创建了PipfilePipfile lock,并且已经运行了初始pipenv install,并且没有调用pipenv shell),我可以根据需要多次运行pipenv install,每次它都说它正在安装74依赖。这是否意味着pipenv install没有生效,或者它只是意味着它正在运行依赖项以确保它们已安装?

似乎可能存在问题,因为当我为该文件夹的项目打开Pycharm时,它会给我以下警告(“包要求...”以及从Pipfile.lock安装需求的选项)。

我正在使用最新的Pycharm设置使用我用pipenv install创建的pipenv环境,我可以确认它正在使用基于Pycharm-> Preferences-> Project-> Project Interpreter的环境,它显示它正在使用这个文件夹的右virtualenv。

但似乎pipenv install和Pycharm都不认为已经安装了依赖项。

enter image description here

python pycharm pipenv
1个回答
1
投票

要回答第二个问题,要求不会再次安装。每次运行pipenv install时都会说它正在安装Pipfile.lock文件中的所有需求,但是如果你运行pipenv install -v使它变得冗长并看到输出,你会看到如下内容:

Installed version (4.1.2) is most up-to-date (past versions: 4.1.2)
Requirement already up-to-date: whitenoise==4.1.2 in c:\users\mihai\.virtualenvs\pipenvtest-1zyry8jn\lib\site-packages (from -r C:\Users\Mihai\AppData\Local\Temp\pipenv-1th31ie1-requirements\pipenv-r4e3zcr7-requirement.txt (line 1))
 (4.1.2)
  Since it is already installed, we are trusting this package without checking its hash. To ensure a completely repeatable environment, install into an empty virtualenv.
Cleaning up...
Removed build tracker 'C:\\Users\\Mihai\\AppData\\Local\\Temp\\pip-req-tracker-ip_gjf7h'

所以要回答你的问题,它只是通过它们检查它们是否已安装,只在必要时安装它们。

© www.soinside.com 2019 - 2024. All rights reserved.