pelican-plugins / search

Pelican plugin that adds site search capability

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unexpected keyword argument 'capture_output'

radoeka opened this issue · comments

Installed the module according the installation documentation.

But get the following error msg: CRITICAL TypeError: init() got an unexpected keyword argument 'capture_output'

Stork --help, results in the expected output.

I've added the plugin to the configuration, as well as the settings:

PLUGINS = [ .....
  'post_stats', 'related_posts', 'search', 'seo', 'simple_footnotes', 'share_post', 'sitemap',
  ....
]

SEARCH_MODE = "output"
SEARCH_HTML_SELECTOR = "main"

Can this be investigated?

Hi Richard. Given that I've never seen the error in question, I think you are best-positioned to investigate the source of the error. I'll try to help if I can.

As mentioned in the How to Get Help section of the documentation, it's best to rule out other potential causes by working from a clean environment. That might look like:

  • create a fresh virtual environment
  • Pip-install latest version of Pelican
  • Pip-install the Search plugin
  • comment out PLUGINS, SEARCH_MODE, SEARCH_HTML_SELECTOR, and any other non-critical settings
  • try building via pelican --debug -s pelicanconf.py content

After doing the above, do you get the same error? If not, then you know the problem lies elsewhere. If you get the same error, post the relevant traceback to https://dpaste.com/ or some other paste-bin site and then comment here with a link to that traceback.

Hey Richard. Were you able to perform the aforementioned steps and glean more information regarding the source of the error you encountered?

Justin thanks for your support.

I already use a virtual environment dedicated for pelican. As such it contains only packages that are used for pelican.

When I search the installed virtual environment for capture_output I get the following output:

python/venv/blog/lib64/python3.6/site-packages/jedi/third_party/typeshed/stdlib/3/subprocess.pyi:        capture_output: bool = ...,

python/venv/blog/lib64/python3.6/site-packages/jupyter_client/tests/test_client.py:from IPython.utils.capture import capture_output
python/venv/blog/lib64/python3.6/site-packages/jupyter_client/tests/test_client.py:        with capture_output() as io:

python/venv/blog/lib64/python3.6/site-packages/pelican/plugins/search/search.py:                capture_output=True,

python/venv/blog/lib64/python3.6/site-packages/IPython/terminal/tests/test_interactivshell.py:from IPython.utils.capture import capture_output
python/venv/blog/lib64/python3.6/site-packages/IPython/terminal/tests/test_interactivshell.py:        with capture_output() as captured:

(the list is much longer, I only selected the first line).

I think (to remember) that I tried to install/use the Jupyter notebook plugin. That probably pulled in the modules above.

Doesn't that mean that when others that have the Jupyter notebook installed and want to use this "search" plugin will run into the same problem?

Is it possible for you to install the jupyter notebook plugin, and see if you get the same error message?

capture_output argument to subprocess.run (here) is added in python 3.7. And you're on python 3.6. I'd suggest upgrading to a newer python since 3.6 will be End-of-Life in a month and we will likely drop support for it in pelican as well.

@radoeka: Were you able to try again with Python 3.7 (or higher)?

@justinmayer no, I haven't. My up to date Linux distribution comes with python 3.6.13. I looked into upgrading to 3.10, but packages depending on the currently installed are to be removed. That's not what I want. I rather wait till my distro (after upgrade) provides a newer python. But this will takes some time.

@radoeka: I suggest using asdf and the asdf Python plugin to install a supported Python interpreter, as Python 3.6 has been end-of-life’d.

In the mean time, I'm going to close this since the issue of using an unsupported Python version isn't really related to this project. If there is anything else we can do to help, please let us know.

OK. Thanks.