For example, if you want to install spacy libray with version 3.5.1 and NLTK version 3.8.1, you need to mention those in the text file like below: spacy=3.5.1 To create a requirements file, simply open a text editor and list the packages you want to install, each on a new line, in the format package_name=version_number. While implementing any GitHub project you may see that the GitHub projects contain a riqurement.txt file.Ī requirements file is nothing but a simple text file which contains list of all the packages you want to install along with their version numbers. Method 2: Install packages from a requirements fileĪnother common way to install multiple packages using requirements files. pip install numpy=1.19.3 pandas=1.2.0Ībove command will install numpy version 1.19.3 and pandas version 1.2.0 in your Python environment. Now if you want to install a specific version of any package you want to install. Install specific versions of different packages This means that pip will first install numpy package then it will install pandas. Note that, above command will install packages in a specific order. To do this, you just need to mention list of packages you want to install separated by a space after the pip install command.įor example, if you want to install numpy and pandas, you can run the following command in your terminal: pip install numpy pandasĪbove single line command will install multiple packages ( numpy and pandas) at once. The simplest way to install multiple packages in Python is by using the pip install command. Method 1: Install multiple packages using pip In this post, we will explore different ways to install multiple packages in Python using pip or without pip. For some projects sometimes you may need to install multiple packages at once. If you are working or learning Python then you must use different packages or libraries to develop something new.
0 Comments
Leave a Reply. |