sethblack / python-seo-analyzer

An SEO tool that analyzes the structure of a site, crawls the site, count words in the body of the site and warns of any technical SEO issues.
Other
1.19k stars 310 forks source link

ModuleNotFoundError: No module named 'lxml' #82

Closed hapesurya closed 2 years ago

hapesurya commented 2 years ago

I use Python 3.8.10 I use virtual environment to run your script I check my web already have index.xml

When i run it from terminal :

seoanalyze http://www.domain.com/

or

seoanalyze http://www.domain.com/ --sitemap http://www.domain.com/sf2-sitemap/index.xml

it response :

Traceback (most recent call last): File "...../my-venv/bin/seoanalyze", line 7, in from seoanalyzer.main import main File "...../my-venv/lib/python3.8/site-packages/seoanalyzer/init.py", line 3, in from .analyzer import analyze File "...../my-venv/lib/python3.8/site-packages/seoanalyzer/analyzer.py", line 5, in from seoanalyzer.website import Website File "...../my-venv/lib/python3.8/site-packages/seoanalyzer/website.py", line 9, in from seoanalyzer.page import Page File "...../my-venv/lib/python3.8/site-packages/seoanalyzer/page.py", line 8, in import lxml.html as lh ModuleNotFoundError: No module named 'lxml'

Need your help. Many thanks.

j-masci commented 2 years ago

pip install lxml worked for me, is there something i'm missing here?

sethblack commented 2 years ago

Hmm, strange. Yeah, looks like lxml disappeared from the dependencies; but it's still in the requirements.txt. I'll get that updated and pushed out with the next version.

The temporary workaround is exactly what @j-masci said, installing lxml into your virtual environment will fix the issue.