Help with tool installation on Mac

137 views
Skip to first unread message

Christopher Hapka

unread,
Nov 28, 2023, 6:50:54 AM11/28/23
to Standard Ebooks
I've been having issues with my standardebooks tools installation on MacOS. I suspect the problem started when I installed tesseract on my system using Homebrew.

I thought I had fixed it by uninstalling and reinstalling the tools, but I'm still getting an error message when I try to run build. Here's my error message. Any ideas? I've checked and it says I have the most recent version, and as I said I've already tried uninstalling and reinstalling with pipx.

% se build -o ../dist .

Traceback (most recent call last):

  File "/Users/chapka/.local/bin/se", line 8, in <module>

    sys.exit(main())

             ^^^^^^

  File "/Users/chapka/.local/pipx/venvs/standardebooks/lib/python3.12/site-packages/se/main.py", line 81, in main

    sys.exit(getattr(module, command_function)(args.plain_output))

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/chapka/.local/pipx/venvs/standardebooks/lib/python3.12/site-packages/se/commands/build.py", line 56, in build

    se_epub.build(args.check, args.check_only, args.build_kobo, args.build_kindle, Path(args.output_dir), args.proof)

  File "/Users/chapka/.local/pipx/venvs/standardebooks/lib/python3.12/site-packages/se/se_epub.py", line 1266, in build

    from se.se_epub_build import build # pylint: disable=import-outside-toplevel

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/chapka/.local/pipx/venvs/standardebooks/lib/python3.12/site-packages/se/se_epub_build.py", line 14, in <module>

    from distutils.dir_util import copy_tree # pylint: disable=deprecated-module

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ModuleNotFoundError: No module named 'distutils'

Erin

unread,
Nov 28, 2023, 7:49:55 AM11/28/23
to Standard Ebooks
The standardebooks package currently needs to be installed using python 3.11, because python 3.12 has eliminated the distutils module, but se_epub_build.py still uses it (as you see in the traceback). The Mac OS installation instructions in the tools readme were updated recently after another producer encountered the same issue. Mac OS users now need to 1) make sure they have python 3.11 installed and 2) specify the python version with which pipx installs se, with `pipx install --python python3.11 standardebooks`. If you uninstall again then follow the instructions for Mac OS in the current readme, se should install successfully.

Christopher Hapka

unread,
Nov 28, 2023, 8:13:07 AM11/28/23
to Standard Ebooks
That took care of it, thanks!

David at Standard Ebooks

unread,
Dec 1, 2023, 7:48:51 PM12/1/23
to Standard Ebooks
Any clues as to how to install the editable version of SE for developers with this new requirement? I get this error message when I follow the instructions in ReadMe on github:

ERROR: Package 'standardebooks' requires a different Python: 3.12.0 not in '<=3.11,>=3.8'
Cannot determine package name from spec '/Users/david/tools'. Check package spec for errors.
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/cf07dd20-7f34-4f3f-8c9c-d3dac56bd870n%40googlegroups.com.

Vince

unread,
Dec 1, 2023, 8:09:16 PM12/1/23
to standar...@googlegroups.com
Same as for non-editable, presumably—you have to specify python 3.11 on the pipx command if your default is 3.12.

David at Standard Ebooks

unread,
Dec 1, 2023, 8:37:33 PM12/1/23
to standar...@googlegroups.com
Well this didn't work, same error:

pipx install --python python3.11 --editable ./tools
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.

Erin

unread,
Dec 1, 2023, 8:47:45 PM12/1/23
to Standard Ebooks
David, I've been getting the same error for a while when I run `pipx install --editable --python python3.11 path/to/tools`:  ERROR: Package 'standardebooks' requires a different Python: 3.11.6 not in '<=3.11,>=3.7'. Is that what you are getting?

If I edit the `python_requires` variable in setup.py so it's `<3.12`, not `<=3.11`, then the editable version installs, so that's what I've been doing. However, I just pulled the commits increasing the minimum/earliest python version from 3.7 to 3.8 and the above error doesn't arise anymore with  `pipx install --editable --python python3.11 path/to/tools`. Not sure why that would have fixed it, though.

Erin

unread,
Dec 1, 2023, 9:02:27 PM12/1/23
to Standard Ebooks
Actually ignore that; I didn't realise further commits had been made to tools over the past day. It looks like everything is compatible with python 3.12 now. So if you pull the latest commits from tools you should be able to just use `pipx install --editable ./tools` as usual.

David at Standard Ebooks

unread,
Dec 2, 2023, 5:18:58 AM12/2/23
to Standard Ebooks
Great, thanks. My timing was obviously bad!
Reply all
Reply to author
Forward
0 new messages