Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

インストールできません。ERROR: Could not build wheels for pymupdf, which is required to install pyproject.toml-based projects #2

Closed
inaPhy opened this issue Nov 4, 2023 · 3 comments

Comments

@inaPhy
Copy link

inaPhy commented Nov 4, 2023

はじめまして
論文をどうにか整理したいと思い,無謀にもWindows環境で構築しようと,Pythonをインストールしたり,環境変数を設定したり,git for windowsをインストールしたりとズブの素人が綱渡りでここまで来ましたが,インストールができません
以下のようなエラーが出て止まってしまいます

なにか解決策はありますか?
よろしくお願いします

メッセージ

ERROR: Could not build wheels for pymupdf, which is required to install pyproject.toml-based projects

環境

C:\Users\hoge>pip -V
pip 23.3.1 from C:\Users\hoge\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip (python 3.12)

C:\Users\hoge>python -V
Python 3.12.0

試したこと

python -m pip install -U pip
pip install -U wheel
pip install -U setuptools

コマンドプロンプト(全文)ここから

C:\Users\hoge>pip install git+https://github.com/issakuss/papnt.git@main
Collecting git+https://github.com/issakuss/papnt.git@main
Cloning https://github.com/issakuss/papnt.git (to revision main) to c:\users\hoge\appdata\local\temp\pip-req-build-79_08whr
Running command git clone --filter=blob:none --quiet https://github.com/issakuss/papnt.git 'C:\Users\hoge\AppData\Local\Temp\pip-req-build-79_08whr'
Resolved https://github.com/issakuss/papnt.git to commit acfcaed
Preparing metadata (setup.py) ... done
Collecting bibtexparser>=1.4.0 (from papnt==0.0.1)
Using cached bibtexparser-1.4.1-py3-none-any.whl
Collecting click>=8.0.4 (from papnt==0.0.1)
Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting crossrefapi>=1.5.0 (from papnt==0.0.1)
Using cached crossrefapi-1.6.0-py3-none-any.whl.metadata (538 bytes)
Collecting iso4>=0.0.2 (from papnt==0.0.1)
Using cached iso4-0.0.2-py3-none-any.whl
Collecting nltk>=3.6.7 (from papnt==0.0.1)
Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB)
Collecting notion-client>=2.0.0 (from papnt==0.0.1)
Using cached notion_client-2.0.0-py2.py3-none-any.whl (13 kB)
Collecting pdf2doi>=1.5 (from papnt==0.0.1)
Using cached pdf2doi-1.5-py3-none-any.whl (34 kB)
Collecting unidecode>=1.3.6 (from papnt==0.0.1)
Using cached Unidecode-1.3.7-py3-none-any.whl.metadata (13 kB)
Collecting pyparsing>=2.0.3 (from bibtexparser>=1.4.0->papnt==0.0.1)
Using cached pyparsing-3.1.1-py3-none-any.whl.metadata (5.1 kB)
Collecting colorama (from click>=8.0.4->papnt==0.0.1)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting requests<3.0.0,>=2.31.0 (from crossrefapi>=1.5.0->papnt==0.0.1)
Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting urllib3==1.26.16 (from crossrefapi>=1.5.0->papnt==0.0.1)
Using cached urllib3-1.26.16-py2.py3-none-any.whl.metadata (48 kB)
Collecting regex>=2017.4.5 (from iso4>=0.0.2->papnt==0.0.1)
Using cached regex-2023.10.3-cp312-cp312-win_amd64.whl.metadata (41 kB)
Collecting joblib (from nltk>=3.6.7->papnt==0.0.1)
Using cached joblib-1.3.2-py3-none-any.whl.metadata (5.4 kB)
Collecting tqdm (from nltk>=3.6.7->papnt==0.0.1)
Using cached tqdm-4.66.1-py3-none-any.whl.metadata (57 kB)
Collecting httpx>=0.15.0 (from notion-client>=2.0.0->papnt==0.0.1)
Using cached httpx-0.25.1-py3-none-any.whl.metadata (7.1 kB)
Collecting google>=3.0.0 (from pdf2doi>=1.5->papnt==0.0.1)
Using cached google-3.0.0-py2.py3-none-any.whl (45 kB)
Collecting pypdf2==2.0.0 (from pdf2doi>=1.5->papnt==0.0.1)
Using cached PyPDF2-2.0.0-py3-none-any.whl (88 kB)
Collecting pdftitle>=0.3 (from pdf2doi>=1.5->papnt==0.0.1)
Using cached pdftitle-0.11-py3-none-any.whl
Collecting feedparser>=6.0.2 (from pdf2doi>=1.5->papnt==0.0.1)
Using cached feedparser-6.0.10-py3-none-any.whl (81 kB)
Collecting pyperclip (from pdf2doi>=1.5->papnt==0.0.1)
Using cached pyperclip-1.8.2-py3-none-any.whl
Collecting easygui (from pdf2doi>=1.5->papnt==0.0.1)
Using cached easygui-0.98.3-py2.py3-none-any.whl (92 kB)
Collecting pdfminer.six==20221105 (from pdf2doi>=1.5->papnt==0.0.1)
Using cached pdfminer.six-20221105-py3-none-any.whl (5.6 MB)
Collecting pymupdf==1.21.0 (from pdf2doi>=1.5->papnt==0.0.1)
Using cached PyMuPDF-1.21.0.tar.gz (57.2 MB)
Preparing metadata (setup.py) ... done
Collecting charset-normalizer>=2.0.0 (from pdfminer.six==20221105->pdf2doi>=1.5->papnt==0.0.1)
Using cached charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl.metadata (34 kB)
Collecting cryptography>=36.0.0 (from pdfminer.six==20221105->pdf2doi>=1.5->papnt==0.0.1)
Using cached cryptography-41.0.5-cp37-abi3-win_amd64.whl.metadata (5.3 kB)
Collecting sgmllib3k (from feedparser>=6.0.2->pdf2doi>=1.5->papnt==0.0.1)
Using cached sgmllib3k-1.0.0-py3-none-any.whl
Collecting beautifulsoup4 (from google>=3.0.0->pdf2doi>=1.5->papnt==0.0.1)
Using cached beautifulsoup4-4.12.2-py3-none-any.whl (142 kB)
Collecting anyio (from httpx>=0.15.0->notion-client>=2.0.0->papnt==0.0.1)
Using cached anyio-4.0.0-py3-none-any.whl.metadata (4.5 kB)
Collecting certifi (from httpx>=0.15.0->notion-client>=2.0.0->papnt==0.0.1)
Using cached certifi-2023.7.22-py3-none-any.whl.metadata (2.2 kB)
Collecting httpcore (from httpx>=0.15.0->notion-client>=2.0.0->papnt==0.0.1)
Using cached httpcore-1.0.1-py3-none-any.whl.metadata (20 kB)
Collecting idna (from httpx>=0.15.0->notion-client>=2.0.0->papnt==0.0.1)
Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting sniffio (from httpx>=0.15.0->notion-client>=2.0.0->papnt==0.0.1)
Using cached sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting cffi>=1.12 (from cryptography>=36.0.0->pdfminer.six==20221105->pdf2doi>=1.5->papnt==0.0.1)
Using cached cffi-1.16.0-cp312-cp312-win_amd64.whl.metadata (1.5 kB)
Collecting soupsieve>1.2 (from beautifulsoup4->google>=3.0.0->pdf2doi>=1.5->papnt==0.0.1)
Using cached soupsieve-2.5-py3-none-any.whl.metadata (4.7 kB)
Collecting h11<0.15,>=0.13 (from httpcore->httpx>=0.15.0->notion-client>=2.0.0->papnt==0.0.1)
Using cached h11-0.14.0-py3-none-any.whl (58 kB)
Collecting pycparser (from cffi>=1.12->cryptography>=36.0.0->pdfminer.six==20221105->pdf2doi>=1.5->papnt==0.0.1)
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Using cached crossrefapi-1.6.0-py3-none-any.whl (14 kB)
Using cached urllib3-1.26.16-py2.py3-none-any.whl (143 kB)
Using cached Unidecode-1.3.7-py3-none-any.whl (235 kB)
Using cached httpx-0.25.1-py3-none-any.whl (75 kB)
Using cached pyparsing-3.1.1-py3-none-any.whl (103 kB)
Using cached regex-2023.10.3-cp312-cp312-win_amd64.whl (268 kB)
Using cached requests-2.31.0-py3-none-any.whl (62 kB)
Using cached joblib-1.3.2-py3-none-any.whl (302 kB)
Using cached tqdm-4.66.1-py3-none-any.whl (78 kB)
Using cached certifi-2023.7.22-py3-none-any.whl (158 kB)
Using cached charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl (100 kB)
Using cached cryptography-41.0.5-cp37-abi3-win_amd64.whl (2.7 MB)
Using cached anyio-4.0.0-py3-none-any.whl (83 kB)
Using cached httpcore-1.0.1-py3-none-any.whl (76 kB)
Using cached cffi-1.16.0-cp312-cp312-win_amd64.whl (181 kB)
Using cached soupsieve-2.5-py3-none-any.whl (36 kB)
Building wheels for collected packages: papnt, pymupdf
Building wheel for papnt (setup.py) ... done
Created wheel for papnt: filename=papnt-0.0.1-py3-none-any.whl size=10637 sha256=fc7799a3dc8f31ff8956f0e8f138a9daa90d84d8d710c20ee2038cb2d7f2776d
Stored in directory: C:\Users\hoge\AppData\Local\Temp\pip-ephem-wheel-cache-lr_inj5t\wheels\31\a4\2d\b38b38154634d910ab29dda12ecaeefb88d6f1050bb8a70a33
Building wheel for pymupdf (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [63 lines of output]
PyMuPDF/setup.py: sys.argv: ['C:\Users\hoge\AppData\Local\Temp\pip-install-peqgqfc0\pymupdf_b8c7df6373b746cc8fcc721a5ba56a4c\setup.py', 'bdist_wheel', '-d', 'C:\Users\hoge\AppData\Local\Temp\pip-wheel-vorbfpf1']
PyMuPDF/setup.py: os.getcwd(): C:\Users\hoge\AppData\Local\Temp\pip-install-peqgqfc0\pymupdf_b8c7df6373b746cc8fcc721a5ba56a4c
PyMuPDF/setup.py: file: C:\Users\hoge\AppData\Local\Temp\pip-install-peqgqfc0\pymupdf_b8c7df6373b746cc8fcc721a5ba56a4c\setup.py
PyMuPDF/setup.py: $PYTHON_ARCH: None
PyMuPDF/setup.py: os.environ (42):
PyMuPDF/setup.py: ALLUSERSPROFILE: C:\ProgramData
PyMuPDF/setup.py: APPDATA: C:\Users\hoge\AppData\Roaming
PyMuPDF/setup.py: COMMONPROGRAMFILES: C:\Program Files\Common Files
PyMuPDF/setup.py: COMMONPROGRAMFILES(X86): C:\Program Files (x86)\Common Files
PyMuPDF/setup.py: COMMONPROGRAMW6432: C:\Program Files\Common Files
PyMuPDF/setup.py: COMPUTERNAME: MSI
PyMuPDF/setup.py: COMSPEC: C:\WINDOWS\system32\cmd.exe
PyMuPDF/setup.py: CONFIGSETROOT: C:\WINDOWS\ConfigSetRoot
PyMuPDF/setup.py: DRIVERDATA: C:\Windows\System32\Drivers\DriverData
PyMuPDF/setup.py: EFC_2940: 1
PyMuPDF/setup.py: HOMEDRIVE: C:
PyMuPDF/setup.py: HOMEPATH: \Users\hoge
PyMuPDF/setup.py: LOCALAPPDATA: C:\Users\hoge\AppData\Local
PyMuPDF/setup.py: LOGONSERVER: \MSI
PyMuPDF/setup.py: NUMBER_OF_PROCESSORS: 16
PyMuPDF/setup.py: ONEDRIVE: C:\Users\hoge\OneDrive
PyMuPDF/setup.py: ONEDRIVECONSUMER: C:\Users\hoge\OneDrive
PyMuPDF/setup.py: OS: Windows_NT
PyMuPDF/setup.py: PATH: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Users\hoge\AppData\Local\Programs\Python\Python312;C:\Users\hoge\AppData\Local\Programs\Python\Python312\Scripts;C:\Program Files\Git\cmd;C:\Users\hoge\AppData\Local\Microsoft\WindowsApps\Scripts;C:\Users\hoge\AppData\Local\Programs\Python\Launcher;C:\Users\hoge\AppData\Local\Microsoft\WindowsApps;
PyMuPDF/setup.py: PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PyMuPDF/setup.py: PROCESSOR_ARCHITECTURE: AMD64
PyMuPDF/setup.py: PROCESSOR_IDENTIFIER: AMD64 Family 23 Model 104 Stepping 1, AuthenticAMD
PyMuPDF/setup.py: PROCESSOR_LEVEL: 23
PyMuPDF/setup.py: PROCESSOR_REVISION: 6801
PyMuPDF/setup.py: PROGRAMDATA: C:\ProgramData
PyMuPDF/setup.py: PROGRAMFILES: C:\Program Files
PyMuPDF/setup.py: PROGRAMFILES(X86): C:\Program Files (x86)
PyMuPDF/setup.py: PROGRAMW6432: C:\Program Files
PyMuPDF/setup.py: PROMPT: $P$G
PyMuPDF/setup.py: PSMODULEPATH: C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PyMuPDF/setup.py: PUBLIC: C:\Users\Public
PyMuPDF/setup.py: SESSIONNAME: Console
PyMuPDF/setup.py: SYSTEMDRIVE: C:
PyMuPDF/setup.py: SYSTEMROOT: C:\WINDOWS
PyMuPDF/setup.py: TEMP: C:\Users\hoge\AppData\Local\Temp
PyMuPDF/setup.py: TMP: C:\Users\hoge\AppData\Local\Temp
PyMuPDF/setup.py: USERDOMAIN: MSI
PyMuPDF/setup.py: USERDOMAIN_ROAMINGPROFILE: MSI
PyMuPDF/setup.py: USERNAME: hoge
PyMuPDF/setup.py: USERPROFILE: C:\Users\hoge
PyMuPDF/setup.py: WINDIR: C:\WINDOWS
PyMuPDF/setup.py: PIP_BUILD_TRACKER: C:\Users\hoge\AppData\Local\Temp\pip-build-tracker-ljea_0uh
PyMuPDF/setup.py: mupdf_tgz already exists: C:\Users\hoge\AppData\Local\Temp\pip-install-peqgqfc0\pymupdf_b8c7df6373b746cc8fcc721a5ba56a4c\mupdf.tgz
PyMuPDF/setup.py: Extracting C:\Users\hoge\AppData\Local\Temp\pip-install-peqgqfc0\pymupdf_b8c7df6373b746cc8fcc721a5ba56a4c\mupdf.tgz
PyMuPDF/setup.py: mupdf_local='mupdf-1.21.0-source/'
PyMuPDF/setup.py: Building mupdf.
PyMuPDF/setup.py: Cannot find devenv.com in default locations, using: 'devenv.com'
PyMuPDF/setup.py: Building MuPDF by running: cd mupdf-1.21.0-source/&&"devenv.com" platform/win32/mupdf.sln /Build "ReleaseTesseract|x64" /Project mupdf
'"devenv.com"' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\hoge\AppData\Local\Temp\pip-install-peqgqfc0\pymupdf_b8c7df6373b746cc8fcc721a5ba56a4c\setup.py", line 625, in
subprocess.run( command, shell=True, check=True)
File "C:\Users\hoge\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'cd mupdf-1.21.0-source/&&"devenv.com" platform/win32/mupdf.sln /Build "ReleaseTesseract|x64" /Project mupdf' returned non-zero exit status 1.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pymupdf
Running setup.py clean for pymupdf
Successfully built papnt
Failed to build pymupdf
ERROR: Could not build wheels for pymupdf, which is required to install pyproject.toml-based projects

ここまで

@issakuss
Copy link
Owner

issakuss commented Nov 4, 2023

はじめまして。
Papntに興味を持ってくださり、とても嬉しく存じます。
インストールにお手数おかけしてしまい申し訳ありません。
PyMuPDFのインストールに失敗してしまっているようですね。
結論から申しますと、Pythonのバージョンを3.11へ落としてから再度試してみていただけますでしょうか。

調べたところ、同様のトラブルが報告されているのが見つかりました。
pymupdf/PyMuPDF#2037

リンク先の情報を要約すると、
使用しているPython用のwheelが用意されていないためにsdistでインストールしようとしたが、sdistに必要なVisualStudioやSWIGなどが用意されていないために失敗している、とのことです。

そのため対応法としては、
① wheelの用意されたPythonを使う
② sdistをするための環境を整える
のいずれかになるようです。

さらに調べたところ、Python 3.12用のwheelは、PyMuPDF==1.23.5 まで対応していないようです。
pymupdf/PyMuPDF#2723
しかし、Papntが使用しているパッケージであるpdf2doiは、PyMuPDF==1.21.0 のインストールを指定しています。
そのためにwheelによるインストールに失敗しているようです。

Python3.11用のwheelなら、PyMuPDF==1.21.0にも用意されているようです。
pymupdf/PyMuPDF#1993
そんなわけですので、Python 3.11をインストールしたうえで再度試していただけますでしょうか。

Windows環境が手元になく、私自身で試すことができず申し訳ありません。

@inaPhy
Copy link
Author

inaPhy commented Nov 4, 2023

Python3.11にダウングレードしたところうまくインストールできました!
実行もうまくいきました!
自動で入力されたときは感動しました!ありがとうございます。
たまに読み取れないDOIもあるようですが,そのあたりは手入力いたします!
とてつもなく便利なツールとなりました!

@issakuss
Copy link
Owner

issakuss commented Nov 8, 2023

喜んでいただけてとても嬉しいです!
インストールの失敗についてご報告いただきありがとうございました。

@issakuss issakuss closed this as completed Nov 8, 2023
issakuss added a commit that referenced this issue Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants