AttributeError: module 'pypandoc' has no attribute 'convert'
Asked Answered
V

3

6

I am trying to switch a python project over to poetry & pyproject.toml. Previously, we were using requirements.txt.

When I try to install pyspark 2.4.8 with poetry, however, I hit this error:

File "<string>", line 156, in <module>
AttributeError: module 'pypandoc' has no attribute 'convert'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Has anyone run into this? Do you know why this is an issue with poetry but not with requirements.txt?

Vendible answered 9/12, 2022 at 16:6 Comment(1)
Share your requirements.txt file and toml filePoetry
F
6

I solved this problem with:

pip install pypandoc==1.5

Fortyfour answered 21/2, 2023 at 23:33 Comment(2)
pip install 'pypandoc<1.8' was sufficient for me given the answer of @sangoAppellation
this did not resolve it for meHalvaard
H
2

it seems you need to downgrade it since 'convert' was removed in the 1.8 version. https://github.com/man-group/pytest-plugins/issues/87

Herring answered 10/1, 2023 at 16:52 Comment(0)
S
0

Change the call from pypandoc.convert('README.md', 'rst') to pypandoc.convert_file('README.md', 'rst')

Superjacent answered 15/1 at 21:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.