我像这样创建我的requirements.txt
delorean==1.0.0
requests==2.18.4
我尝试在虚拟环境中调用 pip install -r requirements.txt
。但它没有显示任何东西。
gangzhao@Gangs-MacBook-Pro yashirq % source .venv/bin/activate
(.venv) gangzhao@Gangs-MacBook-Pro yashirq % pip install -r Practice/Python/Automation/requirements.txt
(.venv) gangzhao@Gangs-MacBook-Pro yashirq % python
Python 3.8.2 (default, Nov 4 2020, 21:23:28)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import delorean
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'delorean'
编辑:尝试 pip -v install -r ...
,@Seluck 建议
(.venv) gangzhao@Gangs-MacBook-Pro yashirq % pip -v install -r Practice/Python/Automation/requirements.txt
Using pip 20.3.3 from /Volumes/Macintosh HD 1/Users/gangzhao/yashirq/.venv/lib/python3.8/site-packages/pip (python 3.8)
Non-user install because user site-packages disabled
Created temporary directory: /private/var/folders/yb/t52k5p7n2rq24_zz5qr2qyrr0000gn/T/pip-ephem-wheel-cache-euxymksy
Created temporary directory: /private/var/folders/yb/t52k5p7n2rq24_zz5qr2qyrr0000gn/T/pip-req-tracker-agcu74g1
Initialized build tracking at /private/var/folders/yb/t52k5p7n2rq24_zz5qr2qyrr0000gn/T/pip-req-tracker-agcu74g1
Created build tracker: /private/var/folders/yb/t52k5p7n2rq24_zz5qr2qyrr0000gn/T/pip-req-tracker-agcu74g1
Entered build tracker: /private/var/folders/yb/t52k5p7n2rq24_zz5qr2qyrr0000gn/T/pip-req-tracker-agcu74g1
Created temporary directory: /private/var/folders/yb/t52k5p7n2rq24_zz5qr2qyrr0000gn/T/pip-install-rmeyk8w9
Created temporary directory: /private/var/folders/yb/t52k5p7n2rq24_zz5qr2qyrr0000gn/T/pip-unpack-jdg1uiy9
Removed build tracker: '/private/var/folders/yb/t52k5p7n2rq24_zz5qr2qyrr0000gn/T/pip-req-tracker-agcu74g1'
编辑:尝试pip list
,@Pro Chess 建议
(.venv) gangzhao@Gangs-MacBook-Pro yashirq % pip install -r Practice/Python/Automation/requirements.txt
(.venv) gangzhao@Gangs-MacBook-Pro yashirq % pip list
Package Version
---------- -------
pip 20.3.3
setuptools 41.2.0
(.venv) gangzhao@Gangs-MacBook-Pro yashirq %