Now that all the dependencies are installed, you can work with requirements.txt. It will look like this: Image showing installation of packages present in requirements.txt file Type this command: pip install -r requirements.txt You can do this by using the command prompt or terminal. To work with the packages, you have to install them. Now that we have the requirements file, you can see that it consists of a long list of different packages. The image above shows the dependencies you can work with along with their versions. Here's the output: Diagram showing the newly created requirements fileĪnd here's your newly created requirements.txt file: Diagram showing lists of packages in requirements file Next, run this command: $ pip freeze > requirements.txtĪnd you'll see that the requirements file gets added Diagram showing set project directory on command line In the command above, replace ‘folder-name’ with the directory name you want to access. Use the following command to do that: $ cd folder-name #cd - change directory Then check to see if the file path shown is your working directory. These are the steps to follow when creating the file:įirst, open your terminal or command prompt. You can use your terminal or command prompt to create your requirements file. But with Visual Studio code, you have to create the virtual environment yourself. If you use Pycharm, there's a virtual environment already setup (.venv). ![]() To create a requirements file, you must set up your virtual environment. You can use Pip to install, uninstall, and manage Python packages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |