assafelovic / gpt-researcher

LLM based autonomous agent that does online comprehensive research on any given topic
https://gptr.dev
Apache License 2.0
14.25k stars 1.86k forks source link

Error in converting Markdown to PDF #571

Closed HeMuling closed 1 month ago

HeMuling commented 3 months ago

Error in converting Markdown to PDF, after clicking download pdf, the local host page will reload and content will be cleared.

in terminal shows:

-----

WeasyPrint could not import some external libraries. Please carefully follow the installation steps before reporting an issue:
https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#installation
https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#troubleshooting

-----

Error in converting Markdown to PDF: cannot load library 'gobject-2.0-0': dlopen(gobject-2.0-0, 0x0002): tried: 'gobject-2.0-0' (no such file), '/System/Volumes/Preboot/Cryptexes/OSgobject-2.0-0' (no such file), '/Users/he_muling/miniconda3/envs/researcher/bin/../lib/gobject-2.0-0' (no such file), '/usr/lib/gobject-2.0-0' (no such file, not in dyld cache), 'gobject-2.0-0' (no such file), '/usr/local/lib/gobject-2.0-0' (no such file), '/usr/lib/gobject-2.0-0' (no such file, not in dyld cache).  Additionally, ctypes.util.find_library() did not manage to locate a library called 'gobject-2.0-0'
Report written to outputs/task_1717657875_latest results regarding cognitive neuroscie.docx

however, i have already installed glib using homebrew, check with pkg-config --cflags --libs gobject-2.0 return:

-I/opt/homebrew/Cellar/glib/2.80.2/include -I/opt/homebrew/Cellar/glib/2.80.2/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.80.2/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.43/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/ffi -L/opt/homebrew/Cellar/glib/2.80.2/lib -L/opt/homebrew/opt/gettext/lib -lgobject-2.0 -lglib-2.0 -lintl

i have followed https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#installation instruction and install with homebrew, the issue persists

also, i noticed that copy button only copies the content while format of markdown is not included, e.g.:

system info:

ElishaKay commented 3 months ago

Hey @HeMuling,

You might have an easier path via Docker Desktop:

Step 1: Install Docker Desktop

Step 2: Walk through this Tutorial

Another requirement I should have mentioned in that video: the path to your files should be within the code of this project. That will enable you to skip the complexity of mounting stuff into Docker

JustUser1410 commented 3 months ago

If you are using conda environment on Windows, make sure you have GTK3 installed before you install the rest of the requirements:

conda install -c conda-forge gtk3