octimot/StoryToolkitAI

Install CLI on Mac M2 (arm64)

Closed this issue · 8 comments

Describe the bug
After installing properly via git Storytoolkit and Whisper. I can't lauch the app. Tokenizer install problem.

To Reproduce
Steps to reproduce the behavior:

  1. % python3.10 -m venv venv

  2. % pip install -r StoryToolkitAI/requirements.txt

  3. Building wheels for collected packages: tokenizers, openai-whisper
    Building wheel for tokenizers (pyproject.toml) ... error
    error: subprocess-exited-with-error

    × Building wheel for tokenizers (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [598 lines of output]

  4. until that line of error :
    error: cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib -- -C 'link-args=-undefined dynamic_lookup -Wl,-install_name,@rpath/tokenizers.cpython-310-darwin.so' failed with code 101
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for tokenizers
Building wheel for openai-whisper (pyproject.toml) ... done
Created wheel for openai-whisper: filename=openai_whisper-20231117-py3-none-any.whl size=801344 sha256=6e8cdb41c901eba99d9c802a6ef5502314bd31703faa95bbe1efb1d3907afeff
Stored in directory: /Users/IMACPRO-JLG/Library/Caches/pip/wheels/48/99/ec/c0ecdd6f6c63e413dae141e383d4bf9b240566d3795dfc689b
Successfully built openai-whisper
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects
5. Traceback (most recent call last):
File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/IMACPRO-JLG/StoryToolkitAI/storytoolkitai/main.py", line 119, in
from storytoolkitai.core.storytoolkitai import StoryToolkitAI
File "/Users/IMACPRO-JLG/StoryToolkitAI/storytoolkitai/../storytoolkitai/core/storytoolkitai.py", line 13, in
from storytoolkitai.core.post_update import post_update
File "/Users/IMACPRO-JLG/StoryToolkitAI/storytoolkitai/../storytoolkitai/core/post_update.py", line 4, in
import packaging
ModuleNotFoundError: No module named 'packaging'

Expected behavior
A clear and concise description of what you expected to happen.

Log file

Screenshots
Mac version

System (please complete the following information):

  • OS: MacOS 14.1.2
  • Python versions installed on machine: 3.10.13
  • StoryToolkitAI Version 0.19.6

Additional context

I think you might be missing rust on your machine.

Did you install step-by-step using the INSTALLATION.md steps?

Cheers!

Hello,I have strictly followed the instruction. And rust is well installed.
I see.

See the recommendations in issue #66:

The following worked for me, although it's certainly not the only way:
brew install rustup
rustup-init
Hit 1 when prompted
source "$HOME/.cargo/env"

And additionally from openai/whisper:

... you may need to configure the PATH environment variable, e.g. export PATH="$HOME/.cargo/bin:$PATH". If the installation fails with No module named 'setuptools_rust', you need to install setuptools_rust, e.g. by running:
pip install setuptools-rust

Please let me know if either of these solutions work!

I have operate all your instructions :
% pip install setuptools-rust
Requirement already satisfied: setuptools-rust in ./venv/lib/python3.10/site-packages (1.8.1)
Requirement already satisfied: setuptools>=62.4 in ./venv/lib/python3.10/site-packages (from setuptools-rust) (68.2.2)
Requirement already satisfied: semantic-version<3,>=2.8.2 in ./venv/lib/python3.10/site-packages (from setuptools-rust) (2.10.0)
Requirement already satisfied: tomli>=1.2.1 in ./venv/lib/python3.10/site-packages (from setuptools-rust) (2.0.1)
But Still have the problem with " Building wheel for tokenizers (pyproject.toml) ... |"

brew install rustup
rustup-init
Hit 1 when prompted
source "$HOME/.cargo/env"
export PATH="$HOME/.cargo/bin:$PATH"

Including these commands, right?

Hey @maaat68

Did you fix this eventually somehow?

A Patreon member recommended removing the version from tokenizers:

  1. In requirements.txt, find tokenizers===0.12.1
  2. Replace that with tokenizers (remove the version)
  3. Retry the installation from step 6

Keep in mind that we might break some functionality of the tool when removing the strict version requirement - I need to do some additional tests to see if anything breaks before committing the change.

But please let me know if this works on your side and if it doesn't break anything else.

Cheers!

This was addressed in #144

@maaat68 If you still see this issue on your machine, just re-open this.