vilcans/screenplain

[Errno 24] Too many open files

rnkn opened this issue · 4 comments

rnkn commented

Hello,

I’ve cloned screenplain, then attempted to install with pip:

$ cd screenplain
$ pip install -e .

Then upon calling screenplain with or without switches (e.g. -h), I get:

OSError: [Errno 24] Too many open files: '/Users/pwr/code/screenplain/bin/screenplain’

I’ve also tried to isolate with a developer environment, but get the same:

$ cd screenplain
$ python -m venv
$ . bin/activate
$ pip install -r requirements.txt
$ pip install -e .

Here’s the full output: https://gist.githubusercontent.com/rnkn/0cd7e0ac4ca9d6ae3b26e52e337db082/raw/f45a40886a0c5deb8c2151d7b77d2b6f4bb72da9/screenplain-error.txt

  • Python 3.7.6
  • macOS 10.15.2 (19C57)

Any ideas?

It looks like the script that the installer created (/Users/pwr/code/screenplain/bin/screenplain on your system) for some reason doesn't find screenplain's main module, and instead loads itself, which makes it load itself again and again recursively until it depletes the operating system's file handles.

Can you look at the file /Users/pwr/code/screenplain/bin/screenplain to see what it's doing? And what are the contents of PYTHONPATH in the shell where you run the screenplain command?

rnkn commented

I did a force git checkout and recreated the venv, and then running screenplain no longer loaded itself recursively, so that one is solved. Now I just get:

Traceback (most recent call last):
  File "/Users/pwr/code/screenplain/bin/screenplain", line 5, in <module>
    from screenplain.main import main
ModuleNotFoundError: No module named 'screenplain'

The contents of bin/screenplain are:

#!/usr/bin/env python
import sys

if __name__ == '__main__':
   from screenplain.main import main
   main(sys.argv[1:])

But this may all be moot as I’m on Python 3. I have a python2 binary on my system, but no pip module for it...

Python 3 should now work. See #54.

rnkn commented

Awesome, thanks.

I’m on macOS Catalina and was missing zlib headers, so Pillow wouldn’t install. I found the fix here https://akrabat.com/installing-pillow-on-macos-10-15-calatalina/ which is:

python3 -m venv .venv
. .venv/bin/activate
export CPATH=$(xcrun --show-sdk-path)/usr/include
pip install -r requirements.txt
pip install -e .

Not sure if this is isolated to just using venv though...