質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

1回答

1393閲覧

pythonモジュール(tree-sitter)のインストールができません

unchi

総合スコア12

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2022/08/02 00:25

前提

pythonモジュール(tree-sitter)のダウンロードができません
(例)
pip installを実行したもののできません
wheelファイルを直接ダウンロードしたもののできません

実現したいこと

インストールがしたい

発生している問題・エラーメッセージ

pip installの場合

% pip install tree-sitter Collecting tree-sitter Using cached tree_sitter-0.20.0.tar.gz (116 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: tree-sitter Building wheel for tree-sitter (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for tree-sitter (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [29 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.9-x86_64-cpython-38 creating build/lib.macosx-10.9-x86_64-cpython-38/tree_sitter copying tree_sitter/__init__.py -> build/lib.macosx-10.9-x86_64-cpython-38/tree_sitter running build_ext building 'tree_sitter.binding' extension creating build/temp.macosx-10.9-x86_64-cpython-38 creating build/temp.macosx-10.9-x86_64-cpython-38/tree_sitter creating build/temp.macosx-10.9-x86_64-cpython-38/tree_sitter/core creating build/temp.macosx-10.9-x86_64-cpython-38/tree_sitter/core/lib creating build/temp.macosx-10.9-x86_64-cpython-38/tree_sitter/core/lib/src gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/KO/opt/anaconda3/include -arch x86_64 -I/Users/KO/opt/anaconda3/include -arch x86_64 -Itree_sitter/core/lib/include -Itree_sitter/core/lib/src -I/Users/KO/opt/anaconda3/include/python3.8 -c tree_sitter/binding.c -o build/temp.macosx-10.9-x86_64-cpython-38/tree_sitter/binding.o -std=c99 -Wno-unused-variable gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/KO/opt/anaconda3/include -arch x86_64 -I/Users/KO/opt/anaconda3/include -arch x86_64 -Itree_sitter/core/lib/include -Itree_sitter/core/lib/src -I/Users/KO/opt/anaconda3/include/python3.8 -c tree_sitter/core/lib/src/lib.c -o build/temp.macosx-10.9-x86_64-cpython-38/tree_sitter/core/lib/src/lib.o -std=c99 -Wno-unused-variable In file included from tree_sitter/core/lib/src/lib.c:11: In file included from tree_sitter/core/lib/src/./lexer.c:5: tree_sitter/core/lib/src/./unicode.h:32:3: error: use of undeclared identifier 'UPRV_BLOCK_MACRO_BEGIN' U8_NEXT(string, i, length, *code_point); ^ tree_sitter/core/lib/src/unicode/utf8.h:351:34: note: expanded from macro 'U8_NEXT' #define U8_NEXT(s, i, length, c) U8_INTERNAL_NEXT_OR_SUB(s, i, length, c, U_SENTINEL) ^ tree_sitter/core/lib/src/unicode/utf8.h:380:55: note: expanded from macro 'U8_INTERNAL_NEXT_OR_SUB' #define U8_INTERNAL_NEXT_OR_SUB(s, i, length, c, sub) UPRV_BLOCK_MACRO_BEGIN { \ ^ 1 error generated. error: command '/usr/bin/gcc' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for tree-sitter Failed to build tree-sitter ERROR: Could not build wheels for tree-sitter, which is required to install pyproject.toml-based projects

wheelファイルを直接ダウンロードし、インストールしようとした場合のエラー

% pip install --no-deps tree_sitter-0.20.0-cp39-cp39-macosx_12_0_arm64.whl ERROR: tree_sitter-0.20.0-cp39-cp39-macosx_12_0_arm64.whl is not a supported wheel on this platform.

試したこと

wheelファイルを直接ダウンロードした

補足情報(FW/ツールのバージョンなど)

環境はmac airでm1チップです

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

jbpb0

2022/08/02 01:17

> tree_sitter-0.20.0-cp39-cp39-macosx_12_0_arm64.whl is not a supported wheel on this platform. 使ってるpythonのバージョンは3.9でしょうか? > 環境はmac airでm1チップです 使ってるpythonはm1用とインテル用(Rosetta環境)のどちらでしょうか?
unchi

2022/08/02 01:27

>使ってるpythonのバージョンは3.9でしょうか? pythonのバージョンは3.9です。pipもバージョンを最新にしています > 使ってるpythonはm1用とインテル用(Rosetta環境)のどちらでしょうか? 申し訳ないです。見分け方がわかりません。pythonなどはanacondaで入れました。m1macを購入した際、非m1のmacから移行したのでもしかするとintelかもしれません
jbpb0

2022/08/02 02:23 編集

> 見分け方がわかりません。 pythonで下記を実行した結果を教えてください import platform print(platform.python_version()) print(platform.uname()) 「platform.uname()」の実行結果の「machine=...」のところで、m1用かインテル用かが分かります https://zenn.dev/stamura/scraps/a938aaf1aae808 の「pythonのアーキテクチャを確認する」
unchi

2022/08/02 02:13

>>> import platform >>> print(platform.python_version()) 3.8.8 >>> print(platform.uname()) uname_result(system='Darwin', node='MacBook-Air-2.local', release='20.3.0', version='Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101', machine='x86_64', processor='i386') すいません pythonのバージョン違いました
jbpb0

2022/08/02 02:24 編集

「machine='x86_64'」なのでインテル用ですね インテル用のpython 3.8なら、 https://pypi.org/project/tree-sitter/0.19.0/#files の tree_sitter-0.19.0-cp38-cp38-macosx_10_14_x86_64.whl を使ってインストールできませんでしょうか? あるいは、下記を実行してもインストールできそうな pip install tree-sitter==0.19.0
guest

回答1

0

3.8.8

uname_result(system='Darwin', node='MacBook-Air-2.local', release='20.3.0', version='Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101', machine='x86_64', processor='i386')

使ってるのがインテル用のpython 3.8なら、
Download files

tree_sitter-0.19.0-cp38-cp38-macosx_10_14_x86_64.whl
を使ってインストールするか、下記を実行するかしたら、インストールできるのではないですかね

terminal

1pip install tree-sitter==0.19.0

投稿2022/08/08 07:51

jbpb0

総合スコア7651

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問