11

I can't get my program to use pandoc from inside a venv.

I can use pandoc from the system context.

From inside the venv

which pandoc
/usr/bin/pandoc 

I've installed pandoc inside the venv with pip, and confirmed the files are in the venv.

What am I missing?

top 4 comments
sorted by: hot top controversial new old
[-] kippinitreal@lemmy.world 3 points 4 days ago* (last edited 4 days ago)

echo your $PATH & site-packages after activating venv. The activation logic does some juggling with the PATH so maybe pandoc slipped out?

[-] nate3d@lemmy.world 2 points 4 days ago

Did you activate your virtual python env with ‘source .venv/bin/activate’? You must do that in each new shell unless you add some config to your shell profile config to have it detect the presence of a python venv.

[-] absGeekNZ@lemmy.nz 2 points 4 days ago

Yep.

Prompt changes to (venv) foo@bar.

I can run other libraries

[-] nate3d@lemmy.world 3 points 4 days ago

Okay perfect, just wanted to check.

Next I’d say check your venv to verify the pandoc binary is indeed there:

find $VIRTUAL_ENV -name pandoc

If it’s not there, you should be able to install it by entering a python shell from your venv and do:

import pypandoc
pypandoc.download_pandoc()

Hopefully that’s able to resolve it for ya. Venv should be at the front of your path so it should prefer bins from there.

this post was submitted on 12 Apr 2025
11 points (100.0% liked)

Python

7002 readers
24 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS