It's in the computer python2.7、python3.7、python3.10 Waiting for multiple versions , Some of them come with the software , As a result, the installed package is often not in the version you want , Here are two ways . Welcome to add !
The first one is :
open pycharm
, open setting
, Click on Project:*****
, Click the inverted triangle arrow to select python edition , You can order if you don't have one Show All
Or point the pinion to add a path .
Then click the small plus sign in the figure , Enter the package name in the search box , Select the corresponding package for installation .
The second kind
Use py -version -m pip install packages
, -version Version number ,packages For the package name , Such as to python3.5 install numpy
py -3.5 -m pip install numpy
The third kind of cmd
Open the command line ,cd
Get into python Under installation path , Use python -m pip install packages
,packages For the package name , Such as to python2.7 install python-docx
C:\Users\Administrator>cd c:\
c:\>cd python27
c:\Python27>python -m pip install python-docx
Error notification
Click to download Microsoft Visual C Compiler for Python 2.7
https://mail.python.org/pipermail/python-announce-list/2014-September/010457.html