From 4c806bddc16a2faf12d2d06e7f1c709a7f342417 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Fri, 15 Mar 2024 08:26:50 -0400 Subject: [PATCH 1/2] Add wheel --- pyproject.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e093282c3..f2d24b87d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,8 +23,9 @@ dependencies = [ "tiktoken>=0.4.0", "typer>=0.9.0", "typing_extensions>=4.0.0", - "tzdata>=2023.3", # need for windows - "uvicorn>=0.22.0" + # need for windows + "tzdata>=2023.3", + "uvicorn>=0.22.0", ] [project.optional-dependencies] @@ -60,6 +61,8 @@ audio = [ "PyAudio>=0.2.11", "playsound >= 1.0", "pydub >= 0.25", + # needed to ensure playsound installs + "wheel>=0.43.0", ] video = [ "opencv-python >= 4.5", From a99412eb329b500c924b21aa3e134efe7bc02ad9 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Fri, 15 Mar 2024 09:55:54 -0400 Subject: [PATCH 2/2] Update installation instructions --- docs/welcome/installation.md | 72 ++++++++++++++++++++++++++++++++---- mkdocs.yml | 2 +- pyproject.toml | 7 +++- 3 files changed, 70 insertions(+), 11 deletions(-) diff --git a/docs/welcome/installation.md b/docs/welcome/installation.md index f39eae4ea..eb00f2b2c 100644 --- a/docs/welcome/installation.md +++ b/docs/welcome/installation.md @@ -1,12 +1,12 @@ -# Installation +# Installing Marvin Install Marvin with `pip`: ```shell pip install marvin -``` +``` -To verify your installation, run `marvin version` in your terminal. +To verify your installation, run `marvin version` in your terminal. Upgrade to the latest released version at any time: @@ -14,13 +14,69 @@ Upgrade to the latest released version at any time: pip install marvin -U ``` -## Tutorial - -Now that you've installed Marvin, check out the [tutorial](tutorial.md) to learn how to use it. +Next, check out the [tutorial](tutorial.md) to get started with Marvin. ## Requirements Marvin requires Python 3.9 or greater, and is tested on all major Python versions and operating systems. -## Installing for Development -See the [contributing docs](../../community/development_guide) for instructions on installing Marvin for development. +## Optional dependencies + +Marvin has a few features that have additional dependencies that are not installed by default. If you want to use these features, you can install the optional dependencies with the following commands: + +### Audio features + +Marvin can transcribe and generate speech out-of-the box by working with audio files, but in order to record and play sound, you'll need additional dependencies. See the [documentation](/docs/audio/recording) for more details. + +Please follow the instructions to set up PyAudio and PyDub, then run: + +```shell +pip install marvin[audio] +``` + +#### Set up PyAudio +Marvin's audio features depend on PyAudio, which may have additional platform-dependent instructions. Please review the PyAudio installation instructions [here](https://people.csail.mit.edu/hubert/pyaudio/) for the latest information. + +On macOS, PyAudio depends on PortAudio, which can be installed with [Homebrew](https://brew.sh/): +```shell +brew install portaudio +``` + + +#### Set up PyDub +Marvin's audio features also depend on PyDub, which may have additional platform-dependent instructions. Please review the PyDub installation instructions [here](https://github.com/jiaaro/pydub#dependencies). + +Generally, you'll need to install ffmpeg. + +On macOS, use [Homebrew](https://brew.sh/): +```shell +brew install ffmpeg +``` + +On Linux, use your package manager: +```shell +apt-get install ffmpeg libavcodec-extra +``` + +On Windows, see the PyDub instructions. + +### Video features + +Marvin has utilities for recording video that make it easy to apply vision AI models to video streams. See the [documentation](docs/video/recording) for more details. + +```shell +pip install marvin[video] +``` + +### Development + +Generally, to install Marvin for development, you'll need to use the `dev` extra. However, in practice you'll want to create an editable install from your local source code: + +```shell +pip install -e "path/to/marvin[dev]" +``` + +To build the documentation, you may also have to install certain imaging dependencies of MkDocs Material, which you can learn more about [here](https://squidfunk.github.io/mkdocs-material/plugins/requirements/image-processing/#dependencies). + + +See the [contributing docs](../../community/development_guide) for further instructions. diff --git a/mkdocs.yml b/mkdocs.yml index 256c7e743..4db95ca60 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -10,7 +10,7 @@ nav: - welcome/what_is_marvin.md - Getting started: - - Installing: welcome/installation.md + - Installation: welcome/installation.md - Tutorial: welcome/tutorial.md # - help/legacy_docs.md diff --git a/pyproject.toml b/pyproject.toml index f2d24b87d..67c23d33b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,10 +59,13 @@ tests = [ audio = [ "SpeechRecognition>=3.10", "PyAudio>=0.2.11", + # playsound reqs "playsound >= 1.0", - "pydub >= 0.25", - # needed to ensure playsound installs "wheel>=0.43.0", + "PyObjC", + # pydub reqs + "pydub>=0.25", + "simpleaudio>=1.0", ] video = [ "opencv-python >= 4.5",