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.

  1. Open PyCharm and switch to the project’s virtual environment.
  2. In the top menu bar of PyCharm, select “File” -> “Settings”.
  3. In the pop-up settings window, choose “Project” -> “Project Interpreter”.
  4. Select the project virtual environment in the window on the right to install the specific version package.
  5. Find the package you want to install a specific version of in the list at the bottom, and click the “+” button on the right.
  6. 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.

  1. Open PyCharm and switch to the project’s virtual environment.
  2. In PyCharm’s top menu bar, select “View” -> “Tool Windows” -> “Terminal”.
  3. 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.

  1. Open PyCharm and switch to the project’s virtual environment.
  2. Locate the requirements.txt file in the project’s root directory and open it.
  3. package_name and version_number must match
  4. Save the file, then go to the top menu bar in PyCharm and select “View” -> “Tool Windows” -> “Terminal”.
  5. 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.

bannerAds