Jaymon / pout

Python pretty print on steroids
MIT License
29 stars 0 forks source link

Presumable windows error: ModuleNotFoundError: No module named 'resource' #65

Closed Mandera closed 3 years ago

Mandera commented 3 years ago

pip install pout

import pout
Traceback (most recent call last):
  File "A:/Programming/Python/generalgui/randomtesting.py", line 10, in <module>
    import pout
  File "A:\Programming\Python\venvs\dev\lib\site-packages\pout\__init__.py", line 42, in <module>
    from .interface import (
  File "A:\Programming\Python\venvs\dev\lib\site-packages\pout\interface.py", line 9, in <module>
    import resource
ModuleNotFoundError: No module named 'resource'

resource is a Unix specific package according to this

Jaymon commented 3 years ago

Annoyingly, the official docs don't mention anywhere that the module isn't available on Windows.

I've done a quick patch that will just catch the ImportError and disable pout.m() on windows.

I'd like to figure out a better workaround but I don't currently have a working Windows computer, when I have some time I'll make a windows virtualbox (if possible) and do a more comprehensive fix/workaround.

I haven't pushed up to Pypi yet because I figured you might want to try it out, you can install it directly from Github:

pip install --upgrade "git+https://github.com/Jaymon/pout#egg=pout"

Let me know if it works for you and I'll push it up to Pypi.

Thanks for bringing this to my attention and submitting the issue.

Mandera commented 3 years ago

Ah yeah you're right, it says it very subtly in the navigation: Documentation » The Python Standard Library » Unix Specific Services ».

Ok it seems to work now! No problem