keotl / invert-pdf

A free online PDF colour inverter. (for printing dark PDFs.)
MIT License
97 stars 50 forks source link

Error upon compiling #20

Closed its-me-ghost closed 2 years ago

its-me-ghost commented 2 years ago
PS C:\fakepath\invert-pdf-master> python pdfinvert/main.py
Traceback (most recent call last):
  File "C:\fakepath\invert-pdf-master\pdfinvert\main.py", line 11, in <module>
    import pdfinvert.wsgi
ModuleNotFoundError: No module named 'pdfinvert'
its-me-ghost commented 2 years ago

how do i solve and compile this? i'm using vs code 😅

keotl commented 2 years ago

Hi there, it seems like your PYTHONPATH environment variable does not include the root directory, so Python can't find the pdfinvert module. In your case, you could run $env:PYTHONPATH='C:\fakepath\invert-pdf-master' in Powershell before running Python. You should also be able to set that as a run config for VS Code in launch.json file (see here).

That being said, I have not tried running the app on Windows, so you might run into issues with the external binaries used by invert-pdf, namely ImageMagick and ghostscript. It might be easier to use the docker build.