Qulacs-Osaka / scikit-qulacs

scikit-qulacs is a library for quantum neural network. This library is based on qulacs and named after scikit-learn.
https://qulacs-osaka.github.io/scikit-qulacs/index.html
MIT License
19 stars 6 forks source link

pip install skqulacsでエラーになる #221

Closed forest1040 closed 2 years ago

forest1040 commented 2 years ago

dockerで、ubuntu:2204を起動し、python3pipを入れた状態で、pip install skqulacsを実行するとエラーになる。

# pip install skqulacs
Collecting skqulacs
  Using cached skqulacs-0.2.0-py3-none-any.whl (18 kB)
Collecting scikit-learn<2.0.0,>=1.0.1
  Downloading scikit_learn-1.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30.4/30.4 MB 73.3 MB/s eta 0:00:00
Collecting numpy<2.0.0,>=1.21.4
  Using cached numpy-1.23.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.0 MB)
Collecting scipy<2.0.0,>=1.7.2
  Downloading scipy-1.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (43.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.9/43.9 MB 56.7 MB/s eta 0:00:00
Collecting skqulacs
  Using cached skqulacs-0.1.0-py3-none-any.whl (16 kB)
ERROR: Cannot install skqulacs==0.1.0 and skqulacs==0.2.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    skqulacs 0.2.0 depends on qulacs-osaka<0.3.0 and >=0.2.0
    skqulacs 0.1.0 depends on qulacs-osaka<0.3.0 and >=0.2.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

依存関係のチェックがうまくいっていない?

ikanago commented 2 years ago

僕も ubuntu:22.04 でインストールできませんでした. 僕の環境では以下のエラーがでました.qulacs-osaka の依存解決ができてなさそうです.

ERROR: Could not find a version that satisfies the requirement qulacs-osaka<0.3.0,>=0.2.0 (from skqulacs) (from versions: 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.4.2)
ERROR: No matching distribution found for qulacs-osaka<0.3.0,>=0.2.0
ikanago commented 2 years ago

skqulacs==0.2.0 の pyproject.toml を見てみると確かに qulacs-osaka<0.3.0,>=0.2.0 に依存しているんですが,なぜかそのバージョンは公開されているのにインストールできないです. とりあえず最新の qulacs-osaka=^0.4.2 に依存する skqulacs==0.3.0 をリリースしようと思います.

kotamanegi commented 2 years ago

ubuntu 22.04ではpython 3.10がプレインストールされていますが、python 3.10に対応したのはqulacs-osaka==0.3.0からなのでpython 3.10用のwheelがqulacs-osaka < 0.3.0では用意されていません。 ikanagoさんの発言通り、qulacs-osakaの最新バージョンに追従するのが良い解決策だと思います。

ikanago commented 2 years ago

skqulacs==0.3.0 のインストールが成功するのを ubuntu:22.04 の image で確認しました. ただ,QNNRegressor などを import すると,dev_dependencies にはあるが dependencies にない typing_extensions を import するため,ModuleNotFoundError が出ます. 手動で typing_extensions をインストールすれば一応動きますが,よくないので issue を切ります.

forest1040 commented 2 years ago

https://github.com/Qulacs-Osaka/scikit-qulacs/pull/222 で修正されたのを確認しましたのでクローズします。