![]() ![]() In our scenario, some-old-package version 1.0 is already installed, but awesome-new-package is not yet installed. ![]() This means that pip will not upgrade packages that are already installed and at the correct version.įor example, if requirements.txt contains the following package specifications: some-old-package=1.0 The -upgrade-strategy only-if-needed option tells pip to only upgrade a package if it is required by the specified package versions in requirements.txt. The -r option tells pip to install the packages listed in the specified file (in this case, requirements.txt). To install only the packages from requirements.txt that are not already installed, you can use the pip install command with the -r option and the -upgrade-strategy only-if-needed option: pip install -r requirements.txt -upgrade-strategy only-if-needed My most recent challenge was figuring out how to install only the packages from the requirements file that aren’t already installed. As I continue to learn, I’ve been trying to share helpful information I come across. I’m still relatively new to Python, and especially new to package management in Python. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |