question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot access from my virtual environment

See original GitHub issue

I followed the docs for installation to Windows 10, and as long as I’m not in my Django project’s virtual environment, everything works fine. When I activate my virtual environment, I get the


OSError: no library called "cairo" was found
cannot load library 'C:\Users\####\####\Lib\site-packages\GTK3-Runtime Win64\bin\libcairo-2.dll': error 0x7e
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7e

When I check the

WHERE zlib1.dll

From the environment, the path is found and correct. And the same is true for WHERE libcairo-2.dll.

Since the path is clearly visible within the environment, I don’t understand why I’m getting the error when I run the test command:

python -m weasyprint http://weasyprint.org weasyprint.pdf

From my environment, but not from the standard command prompt.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
Tontynacommented, Mar 8, 2021

What is the output of

python -c "import os; print(*os.environ['PATH'].split(os.pathsep), sep='\n')"

when you run it in your Django environment?

0reactions
Tontynacommented, Mar 9, 2021

@FaxMeBeer if you want to run WeasyPrint from the command prompt, outside of Visual Studio, without the need of an extra Python script, without the need of repeatedly typing SET PATH, you should adjust the PATH in your Windows 10 environment variables.

Read more comments on GitHub >

github_iconTop Results From Across the Web

created virtual environment , but cant access it - Stack Overflow
it shows created virtual environment. But it is not redirect to virtual environment . after I upgraded the pip no changes where appear...
Read more >
Why can't I access 'virtualenv'? - Ask Ubuntu
I've just created a new user account called deployer in my 16.04 VPS and I'd like to create a virtualenv inside directory Env....
Read more >
my virtual environment cannot be found - Super User
I'm on a PC windows 10 and always open git bash, then source activate my-env ...
Read more >
Python Virtual Environments: A Primer
In this tutorial, you'll learn how to work with Python's venv module to create and manage separate virtual environments for your Python ...
Read more >
venv — Creation of virtual environments — Python 3.11.1 ...
A virtual environment is created on top of an existing Python installation, known as the virtual environment's “base” Python, and may optionally be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found