The problem of error reporting when importing openpyxl from Python has finally been solved

Problem: after tossing all morning, openpyxl has been installed and uninstalled many times. The CMD clearly shows that the installation is successful, but an error is reported when the python file is imported

1. After installing openpyxl, the python file import has been reporting errors. After a morning’s efforts, I finally found the correct solution on the Internet

2. After installing openpyxl, you need to add components to pycharm. The steps are as follows

    Help—> In findaction, enter the project interpreter and open the project interpreter

3. Click the “+” sign on the right

 

 

 

4. Enter the available packages interface, enter openpyxl in the input box, and click Install Package below. Later, you will be prompted with “package ‘openpyxl’ install successfully” below

 

5. At this time, if you import openpyxl in Python, you will not report an error

 ( Note: when other packages report errors (such as pandas), import them in DOS Python environment first. If no errors are reported; Then repeat the above steps in pycharm — project interpreter and install the corresponding package.)

Similar Posts: