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

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

新規登録して質問してみよう
ただいま回答率
85.51%
Python

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

FreeBSD

FreeBSDは、Unix系のオープンソースのOSです。PC/AT互換機用ですが、他のプラットフォームにも移植されています。優れたネットワーク・セキュリティ・ストレージ機能で人気のOSです。ソースコードと共に無償で公開されており、多くの コミュニティによって長年に渡って開発されています。

Q&A

解決済

1回答

759閲覧

pythonのcshogiライブラリをfreeBSDにインストールする方法

nyopahase

総合スコア1

Python

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

FreeBSD

FreeBSDは、Unix系のオープンソースのOSです。PC/AT互換機用ですが、他のプラットフォームにも移植されています。優れたネットワーク・セキュリティ・ストレージ機能で人気のOSです。ソースコードと共に無償で公開されており、多くの コミュニティによって長年に渡って開発されています。

0グッド

0クリップ

投稿2023/05/29 10:53

実現したいこと

pythonの将棋ライブラリであるcshogi(https://github.com/TadaoYamaoka/cshogi )をfreeBSDにインストールしたいです。
しかし、エラーが発生し、インストールすることができません。
おそらく、gccが使えないことによるエラーだと推測しましたが、freeBSDではgccでなくclangのはずです。
どのようにすればインストールすることができるでしょうか?

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

> /usr/local/bin/python3.9 -m pip install --no-cache-dir cshogi Defaulting to user installation because normal site-packages is not writeable Collecting cshogi Downloading cshogi-0.5.5.tar.gz (107 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107.8/107.8 kB 8.5 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Building wheels for collected packages: cshogi Building wheel for cshogi (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [37 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39 creating build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi copying cshogi/CSA.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi copying cshogi/KI2.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi copying cshogi/KIF.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi copying cshogi/PGN.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi copying cshogi/__init__.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi copying cshogi/cli.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi copying cshogi/elo.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi creating build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/usi copying cshogi/usi/Engine.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/usi copying cshogi/usi/__init__.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/usi creating build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/gym_shogi copying cshogi/gym_shogi/__init__.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/gym_shogi creating build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/gym_shogi/envs copying cshogi/gym_shogi/envs/__init__.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/gym_shogi/envs creating build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/dlshogi copying cshogi/dlshogi/__init__.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/dlshogi creating build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/web copying cshogi/web/app.py -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/web creating build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/web/templates copying cshogi/web/templates/board.html -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/web/templates creating build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/web/static copying cshogi/web/static/board.js -> build/lib.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/web/static running build_ext building 'cshogi._cshogi' extension creating build/temp.freebsd-13.1-RELEASE-p2-amd64-cpython-39 creating build/temp.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi creating build/temp.freebsd-13.1-RELEASE-p2-amd64-cpython-39/src cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -DHAVE_SSE4 -DHAVE_SSE42 -DHAVE_AVX2 -Isrc -I/usr/local/include/python3.9 -I/home/web-tools/.local/lib/python3.9/site-packages/numpy/core/include -c cshogi/_cshogi.cpp -o build/temp.freebsd-13.1-RELEASE-p2-amd64-cpython-39/cshogi/_cshogi.o -msse4.2 -mavx2 cc: error: no such file or directory: 'cshogi/_cshogi.cpp' cc: error: no input files error: command '/usr/bin/cc' 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 cshogi Running setup.py clean for cshogi Failed to build cshogi ERROR: Could not build wheels for cshogi, which is required to install pyproject.toml-based projects

該当のソースコード

cmd

1pip install --no-cache-dir cshogi

試したこと

ドキュメントに書いてある通り、

cmd

1pip install --no-cache-dir cshogi

を実行した。
また、google検索を試したが、何で検索すればよいのかわからなかった。

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

FreeBSD 10.3-RELEASE-p19 + Apache

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

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

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

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

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

katsuko

2023/05/29 23:56

githubを見るとcythonが必要そうですが、そのあたりはいかがですか。
nyopahase

2023/05/30 11:47

コメントありがとうございます。 インストール済みです。
katsuko

2023/05/31 13:07

なんか色々試したけど、うまく行かないですねー。 ubuntuなどでビルドが成功する環境だと、ログで「running build_ext」の後に「cythoning cshogi/_cshogi.pyx to cshogi/_cshogi.cpp」と出力されるのですが、質問者さんのログだとそれがないので、やっぱりcythonの問題なんじゃないかと思います。 ただ、自分のFreeBSDの環境だと、そこは通っても、「error: definition of builtin function '__builtin_bswap64'」というエラーが出てしまいます。 どうもgccのビルトイン関数らしいので、質問者さんの言うとおりgccとclangの違いで問題が起きそうです。
katsuko

2023/06/01 00:18 編集

一応自分が試したことですが、 * FreeBSDは12.2/13.1(VirtualBox上ですが、10.3で試したかったけどISOイメージが見つからなかった) * numpy/cythonをpipで入れたり、pkgで入れたりしてみた。 いずれの方法でも、質問にあるエラーは出ず、別のエラーが発生しました。
nyopahase

2023/06/01 10:59

そうですね... gccを入れてみようかと検討中です。 ありがとうございました!
guest

回答1

0

自己解決

gccを入れてみます。

投稿2023/06/01 10:59

nyopahase

総合スコア1

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.51%

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

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

質問する

関連した質問