How can I specify the version of a package during PyCharm installation?
There are several methods to specify the installation of a specific version of a package in PyCharm.
Option one: Utilize PyCharm’s Package Manager.
- Open PyCharm and switch to the project’s virtual environment.
- In the top menu bar of PyCharm, select “File” -> “Settings”.
- In the pop-up settings window, choose “Project” -> “Project Interpreter”.
- Select the project virtual environment in the window on the right to install the specific version package.
- Find the package you want to install a specific version of in the list at the bottom, and click the “+” button on the right.
- In the pop-up window, enter the name and version number of the package you want to install, then click the “Install Package” button.
Option 2: Utilize PyCharm’s Terminal.
- Open PyCharm and switch to the project’s virtual environment.
- In PyCharm’s top menu bar, select “View” -> “Tool Windows” -> “Terminal”.
- Install a specific version of a package using the command “pip install package_name==version_number”.
Option:
Method 3: Modify the requirements.txt file of the project.
- Open PyCharm and switch to the project’s virtual environment.
- Locate the requirements.txt file in the project’s root directory and open it.
- package_name and version_number must match
- Save the file, then go to the top menu bar in PyCharm and select “View” -> “Tool Windows” -> “Terminal”.
- Install the packages listed in the requirements.txt file.
Here are three common ways to specify the installation of a specific version of a package in PyCharm. You can choose the method that best suits your needs to proceed.