SoFunction
Updated on 2024-11-13

Pycharm using crawler encountered etree red line problem and solution

Problems with etree redlining when using crawlers

1. First explain the cause of the problem

It is that Pycharm's interpreter does not match the requested interpreter:

The solution is simple:

Replace the Pycharm interpreter with the path to the folder where the python installation is located.

The steps are as follows:

Find the location of the software Pycharm interpreter interpreten and add the above path to see the picture:

在这里插入图片描述

2. No more red lines. Perfect solution.

在这里插入图片描述

lxml and etree redlining issues

cure

1. Check the local python version: python - V (I am here python3.8)

2. Download address:

/~gohlke/pythonlibs/

在这里插入图片描述

Select the version number corresponding to the python version, here select cp38,download.

3. Open a command line in the directory where the downloaded file is located and execute the pip install lxml-4.3.5-cp37-cp37m-win_amd64.whl command:

pip install D:\New Folder\lxml-4.6.2-cp38-cp38-win_amd64.whl

在这里插入图片描述

Successfully.

The solution is successful! The above is a personal experience, I hope it can give you a reference, and I hope you can support me more.