我已经使用virtualenv csip_project -p python3
创建了一个虚拟环境,并试图从requirements.txt
安装依赖项。一切都正确安装,但是在执行程序时,它表明该模块不存在。然后,当我检查pip3 freeze
以查看是否保存了依赖项时,令我惊讶的是,即使pip3 install命令显示了Requirement already satisfied
,它们也没有保存。知道发生了什么吗?这是安装日志和pip3 freeze
的输出。
(csip_project) [app-admin@ip-172-19-35-21 src]$ pip3 install -r requirements.txt
Requirement already satisfied: imutils==0.5.1 in /home/app-admin/csip_project/lib/python3.6/dist-packages (from -r requirements.txt (line 1)) (0.5.1)
Collecting numpy==1.15.1 (from -r requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/fe/94/7049fed8373c52839c8cde619acaf2c9b83082b935e5aa8c0fa27a4a8bcc/numpy-1.15.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting opencv-contrib-python==3.4.2.17 (from -r requirements.txt (line 3))
Using cached https://files.pythonhosted.org/packages/61/29/fc60b2de1713aa92946992544329f20ccb5e4ba26290f403e04b7da44105/opencv_contrib_python-3.4.2.17-cp36-cp36m-manylinux1_x86_64.whl
Collecting Pillow==5.2.0 (from -r requirements.txt (line 4))
Using cached https://files.pythonhosted.org/packages/d1/24/f53ff6b61b3d728b90934bddb4f03f8ab584a7f49299bf3bde56e2952612/Pillow-5.2.0-cp36-cp36m-manylinux1_x86_64.whl
Requirement already satisfied: tqdm==4.25.0 in /home/app-admin/csip_project/lib/python3.6/dist-packages (from -r requirements.txt (line 5)) (4.25.0)
Installing collected packages: numpy, opencv-contrib-python, Pillow
Successfully installed Pillow-5.2.0 numpy-1.15.1 opencv-contrib-python-3.4.2.17
(csip_project) [app-admin@ip-172-19-35-21 src]$ pip3 freeze
imutils==0.5.1
tqdm==4.25.0
(csip_project) [app-admin@ip-172-19-35-21 src]$