Installing Packages from Local Directory Using requirements.txt with Pip
In order to install packages using pip according to the requirements.txt file from a local directory, you can utilize the -r option. This option allows you to specify a requirements file that contains a list of packages and their dependencies. The syntax for using this option is as follows:
pip install -r /path/to/requirements.txt
In your case, the requirements file is located at /path/to/requirements.txt. However, you are also trying to install the packages from a local archive directory using the -f option. This is not necessary as the -r option will automatically install the packages from the specified location.
To correct the issue, simply remove the -f option from the command:
source bin/activate pip install -r /path/to/requirements.txt
This will install the packages according to the requirements.txt file from the local archive directory. You can then verify that the packages are installed properly by importing them into your code or checking the site-packages directory of your virtualenv.
以上がPip でrequirements.txt を使用してローカル ディレクトリからパッケージをインストールする方法の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。