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.18k stars 305 forks source link

TemplateNotFound #33

Closed craigneil closed 5 years ago

craigneil commented 5 years ago

When running with html output request, error received:

Traceback (most recent call last): File "/usr/local/bin/seoanalyze", line 11, in sys.exit(main()) File "/usr/local/lib/python3.6/site-packages/seoanalyzer/main.py", line 33, in main template = env.get_template('index.html') File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 830, in get_template return self._load_template(name, self.make_globals(globals)) File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 804, in _load_template template = self.loader.load(self, name, globals) File "/usr/local/lib/python3.6/site-packages/jinja2/loaders.py", line 113, in load source, filename, uptodate = self.get_source(environment, name) File "/usr/local/lib/python3.6/site-packages/jinja2/loaders.py", line 187, in get_source raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: index.html

benfinklea commented 5 years ago

Same problem here. Almost exactly the same.

Traceback (most recent call last):
  File "/Applications/anaconda3/bin/seoanalyze", line 11, in <module>
    sys.exit(main())
  File "/Applications/anaconda3/lib/python3.6/site-packages/seoanalyzer/__main__.py", line 33, in main
    template = env.get_template('index.html')
  File "/Applications/anaconda3/lib/python3.6/site-packages/jinja2/environment.py", line 830, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/Applications/anaconda3/lib/python3.6/site-packages/jinja2/environment.py", line 804, in _load_template
    template = self.loader.load(self, name, globals)
  File "/Applications/anaconda3/lib/python3.6/site-packages/jinja2/loaders.py", line 113, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/Applications/anaconda3/lib/python3.6/site-packages/jinja2/loaders.py", line 187, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html
celtic-coder commented 5 years ago

Issue #24 mentions the following:

New version pushed to pypi. Should be fixed now.

Edit:

I managed to get 3.1.0 installed and confirmed templates/index.html wasn't being included in the pypi distribution. It is now. Closing the issue.

Has this been done? This issue was closed in June 2018. Does Jinja2 need be reinstalled, for example?

celtic-coder commented 5 years ago

In the meantime, to convert the default output, a useful online JSON to HTML converter can be found at: http://convertjson.com/json-to-html-table.htm

myspoonistoobig commented 5 years ago

For anybody still searching for an answer to this, I think the templates folder is put in the wrong location. If you track down the jinja2.exceptions.TemplateNotFound you can see that it's most often because something can't find the correct path.

If you want to use the tool, you can download and run the source instead of using the pip3 install method. However, you will need to be comfortable with the command line to do this.

Here's what I did on macOS:

sethblack commented 5 years ago

Heyo! This should be fixed in version 3.1.2. It was a syntax error in setup.py. 🤦‍♂