Python: ImportError: lxml not found, please install it

后端 未结 3 1338
温柔的废话
温柔的废话 2021-01-07 19:15

I have the following code (in PyCharm (MacOS)):

import pandas as pd

fiddy_states = pd.read_html(\'https://simple.wikipedia.org/wiki/List_of_U.S._states\')

         


        
相关标签:
3条回答
  • 2021-01-07 19:56

    I got same error, it seems that my python3 was pointing to pandas in python2 (since I have not install pandas in python3). After doing pip3 install pandas and restarting a notebook, it worked fine.

    0 讨论(0)
  • 2021-01-07 19:59

    You can go to Settings > Project Interpreter > Click on '+' icon
    Find 'lxml' from the list of packages and click 'Install Package' button found below.

    I am using PyCharm 2019.2.1 (Community Edition)
    Build #PC-192.6262.63, built on August 22, 2019
    Runtime version: 11.0.3+12-b304.39 amd64
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    Linux 4.15.0-58-generic
    GC: ParNew, ConcurrentMarkSweep
    Memory: 937M
    Cores: 4

    0 讨论(0)
  • 2021-01-07 20:00

    Based on the fact that the error is:

    /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6

    This means that you are working with python-3.6. Now usually the package manager for python-3.x is pip3. So you probably should install it with:

    pip3 install lxml
    0 讨论(0)
提交回复
热议问题