1. 程式人生 > >Pycharm匯入第三方庫

Pycharm匯入第三方庫

命令列模式下使用pip安裝好了一些第三方庫,但在Pycharm中使用時會提示匯入失敗如下:

D:\PycharmProjects\DiscuzScraper\venv\Scripts\python.exe D:/PycharmProjects/DiscuzScraper/Scraper1A.py
Traceback (most recent call last):
File “D:/PycharmProjects/DiscuzScraper/Scraper1A.py”, line 5, in
import lxml.html
ImportError: No module named lxml.html

Process finished with exit code 1

解決方案:

file—setting—Project:[ProjectName]—projectInterpreter–[green add button]—packagename—Install Packetage