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

shioaji 安裝問題 #154

Open
tzupingchenwork opened this issue Sep 18, 2023 · 7 comments
Open

shioaji 安裝問題 #154

tzupingchenwork opened this issue Sep 18, 2023 · 7 comments

Comments

@tzupingchenwork
Copy link

MacOS: 13.5.2 apple silicon
Python: 3.10.6
conda: 23.3.1

因為本身使用 poetry 做套件管理,先使用 poetry add shioaji,但是安裝失敗

使用 poetry 安裝

>> poetry add shioaji

  RuntimeError

  Unable to find installation candidates for pysolace (0.9.30)

  at ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/chooser.py:109 in choose_for
      105│ 
      106│             links.append(link)
      107│ 
      108│         if not links:
    → 109│             raise RuntimeError(f"Unable to find installation candidates for {package}")
      110│ 
      111│         # Get the best link
      112│         chosen = max(links, key=lambda link: self._sort_key(package, link))
      113│ 

後來改用 pip 安裝套件,找不到 shioaji

使用 pip 安裝

>> pip install shioaji


ERROR: Could not find a version that satisfies the requirement shioaji (from versions: none)
ERROR: No matching distribution found for shioaji
@peteranny
Copy link

peteranny commented Sep 18, 2023

我剛使用自己電腦用pip install安裝也有一樣的訊息,但發現是M1晶片的問題,這套件只能用舊版intel晶片。
因此我改用Rosetta模式打開terminal再跑pip install就成功安裝了,供你參考!

@tzupingchenwork
Copy link
Author

Thanks, it works for me!

@htaiwan
Copy link

htaiwan commented Sep 26, 2023

我目前也遇到相同問題,有嘗試改用Rosetta模式打開terminal再跑pip install,還是一樣

MacOS: 13.5.2 apple silicon
Python: 3.10.13
conda 23.7.2

截圖 2023-09-26 下午2 30 03

@chenwei791129
Copy link

m1 都出來多久了,居然還沒相容 arm 架構 ...

@ypochien
Copy link
Contributor

不好意思 底層的一些原件原廠還沒釋出對應的平台,未來會提供,如果需要ARM先找同業吧~~(如果有的話)

@linroex
Copy link

linroex commented Jan 10, 2024

@htaiwan 可以確認一下你的 python 是不是 x86 的

我是 M1 Pro,我這樣做可以成功,給你參考

arch -x86_64 bash

# 確認 python 是否是 x86
file $(which python3)

virtualenv venv --python=$(which python3)
pip install -U shioaji

安裝 x86 python 可以參考這篇: https://tocandraw.com/coding/python/1703/

@ktlast
Copy link

ktlast commented Jun 19, 2024

我也是 Mac M1 正準備開始測試 API。

目前看起來在 docker run 的時候指定 --platform 可以動

docker run -it --rm --platform=linux/amd64 sinotrade/shioaji


Python 3.7.17 (default, Sep 20 2023, 11:59:52)
[GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

參考:https://stackoverflow.com/questions/67458621/how-to-run-amd64-docker-image-on-arm64-host-platform

看起來應該是要有 rosetta 運作中 (沒有測試)

檢查方式:

 pgrep -q oahd && echo "rosetta installed"
 
 # rosetta installed

我是用 OrbStack 目前能 run,Docker Desktop 應該就沒問題。



Note

workflow 說不定可以考慮更新 multi-platfrom build:

...
        name: Build and push
        uses: docker/build-push-action@v2
        with:
          platforms: linux/amd64,linux/arm64
          push: true
          tags: user/app:latest

底層的一些原件原廠還沒釋出對應的平台

不過我不確定目前會不會因為這樣反而 build 失敗。

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

7 participants