How to update third-party libraries in Pycharm (take tensorflow library as an example)
This article mainly records how to update third-party libraries in Pycharm, taking the tensorflow library as an example.
Table of contents
1. Prerequisites
This article is based on the environment where Anaconda3 is installed, and the interpreter associated with Pycharm is the environment in Anaconda3, so I choose to update the third-party library directly in Pycharm.
If Anaconda3 is not installed, you can install and update third-party libraries directly in the terminal.
2. Update the third-party library process in Pycharm
(1) Windows system: Open the main interface File—Settings in Pycharm
MacOS system: Open Pycharm—Preferences in Pycharm
(2) Project—Project Interpreter—Latest version
(3) As shown in the picture below, it can be the current Python interpreter Update the corresponding third-party library. There is a ▲ sign in front of the third-party library that can be updated. After clicking it directly, you can perform the corresponding update operation.
(4) Double-click tensorflow to enter the update interface.
(5) Select the specific version to be updated on the update interface, and click Install Package.
3. Query the current version information of the third-party library in Pycharm
View the information of the current third-party library directly in Pycharm through the following python code
# 以tensorflow库为例进行说明
import tensorflow
print(tensorflow.__version__)
# 输出结果
2.5.0
The update method of other third-party libraries in Pycharm is the same.