diff --git a/Makefile b/Makefile index 43b9615ce..55a697300 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,11 @@ SHELL := /bin/bash ifeq ($(OS),Windows_NT) PYTHON_BIN := python ACTIVATE_SCRIPT := pyenv/Scripts/activate + SYSTEM_PACKAGES := sed -iv -- "s/include-system-site-packages\s*=\s*false/include-system-site-packages = true/g" pyenv/pyvenv.cfg else PYTHON_BIN := python3 ACTIVATE_SCRIPT := pyenv/bin/activate + SYSTEM_PACKAGES := echo Skipping Windows Pythons system packages inheritance activation... endif .SHELLFLAGS := -eu -o pipefail -c @@ -28,6 +30,7 @@ all: run # - add qt if missing pyenv: "${PYTHON_BIN}" -m venv pyenv && \ + ${SYSTEM_PACKAGES} && \ . "${ACTIVATE_SCRIPT}" && \ python --version && \ python -m pip install --upgrade pip setuptools && \ diff --git a/README.development b/README.development index 58291e9b3..6db22b641 100644 --- a/README.development +++ b/README.development @@ -88,11 +88,14 @@ Windows users (using Visual Studio) The problem with the `/usr/bin/` is that it should not exists. Cygwin should map/mount `/bin/` into `/usr/bin/`, i.e., they should be the same directory. 1. Download and install Python for Windows (not from Cygwin) and put `python.exe` (not `python3.exe`) on your system path. -1. Download and install pip for your Windows Python. +1. Download and install pip for your Windows Python (`python -m ensurepip`). 1. Download and install rust (compiler), npm, git and put them your system path. +1. Download and install the pyaudio wheel from: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio + 1. After download the file for your Python version, you can install it using a command like + `python -m pip install PyAudio‑0.2.11‑cp38‑cp38‑win_amd64.whl` + 1. If got an error from pip trying to build the `pyaudio` library, + or there is not a wheel available for your Python version, you can built it from the source + following the installation instructions on: https://github.com/evandroforks/pyaudio 1. Open a `cmd.exe` (command prompt) on the anki repository and run the command `sh run` 1. Do not use `bash run` because it my call for Windows Subsystem for Linux 1. Do not use any Cygwin terminal as `mintty.exe` because the `rust lang` compiler does not work with them - 1. If got an error from pip trying to build the `pyaudio` library, - follow the installation instructions from: https://github.com/evandroforks/pyaudio - and install the `portaudio.lib` on your system. diff --git a/qt/Makefile b/qt/Makefile index bca95a466..4fb91701d 100644 --- a/qt/Makefile +++ b/qt/Makefile @@ -1,12 +1,6 @@ SHELL := /bin/bash FIND := $(if $(wildcard /bin/find),/bin/find,/usr/bin/find) -ifeq ($(OS),Windows_NT) - INSTALL_PYAUDIO := python -m pip install git+https://github.com/evandroforks/pyaudio -else - INSTALL_PYAUDIO := @echo Skipping pyaudio for Windows... -endif - .SHELLFLAGS := -eu -o pipefail -c .DELETE_ON_ERROR: MAKEFLAGS += --warn-undefined-variables @@ -22,7 +16,6 @@ PHONY: all all: check .build/run-deps: setup.py - ${INSTALL_PYAUDIO} python -m pip install -e . @touch $@