From da4427868aa44a12c02d3395ed3706379dcc17d2 Mon Sep 17 00:00:00 2001 From: xxyzz Date: Fri, 7 Jan 2022 19:32:44 +0800 Subject: [PATCH] add macOS install python commands --- README.md | 14 +++++++++++--- config.py | 4 ++-- main.py | 5 +++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 27999a4..ec02aa9 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ A calibre plugin that generates Word Wise and X-Ray files then sends them to Kin Languages X-Ray supports: Català, Dansk, Deutsch, English, Español, Français, Italiano, Lietuvių, Nederlands, Norsk bokmål, Polski, Português, Română, Ελληνικά, Македонски, Русский, 中文, 日本語. -X-Ray doesn't support macOS, because macOS prohibits calibre from loading unsigned library. - ![screenshot](https://user-images.githubusercontent.com/21101839/130245435-b874f19a-7785-4093-9975-81596efc42bb.png) ## Contribute @@ -48,12 +46,22 @@ Please read [CONTRIBUTING](./docs/CONTRIBUTING.md). # pacman -Syu --needed python-pip ``` - - Debian or Ubuntu based distro + - Debian based distro ``` $ sudo apt install python3-pip ``` + - macOS + + ``` + // install from HomeBrew(recommanded) + $ brew install python + + // or install Apple Command Line Tools + $ xcode-select --install + ``` + - Windows: use Chocolatey or download from https://www.python.org/downloads ``` diff --git a/config.py b/config.py index 4800f3b..1b68363 100644 --- a/config.py +++ b/config.py @@ -3,8 +3,8 @@ import webbrowser from calibre.utils.config import JSONConfig -from PyQt5.Qt import (QCheckBox, QComboBox, QHBoxLayout, QLabel, QPushButton, - QVBoxLayout, QWidget) +from PyQt5.QtWidgets import (QCheckBox, QComboBox, QHBoxLayout, QLabel, + QPushButton, QVBoxLayout, QWidget) prefs = JSONConfig('plugins/worddumb') prefs.defaults['search_people'] = False diff --git a/main.py b/main.py index 78b827a..87ea0e2 100644 --- a/main.py +++ b/main.py @@ -19,7 +19,8 @@ class ParseBook: def __init__(self, gui): self.gui = gui plugin_path = Path(config_dir).joinpath('plugins/WordDumb.zip') - self.languages = load_json_or_pickle(plugin_path, 'data/languages.json') + self.languages = load_json_or_pickle( + plugin_path, 'data/languages.json') def parse(self, create_ww=True, create_x=True): # get currently selected books @@ -120,7 +121,7 @@ def subprocess_error(self, job): 'because they hate me.', ''' Run the command "sudo apt install python3-pip" to install - pip module if you are using Debian or Ubuntu based distro. + pip module if you are using Debian based distro.

If you still have this error, make sure you installed calibre with the