LoginSignup
2
0

More than 5 years have passed since last update.

PySideをpipでインストールしようとするとエラーを吐く場合の回避策

Last updated at Posted at 2016-12-17

追記
Qt for Python 5.11(Pyside2)が正式リリースされていたのでリンクだけ修正しました。
文言が古いところがありますが、同じやり方で対処可能なこと確認済みです。


Windowsでの話です。Anaconda3-2.3.0環境ですが、他でも同様に対処可能だと思います。私の具体例以外のエラーに対しても対処可能です。

公式サイトの手順通り、コマンドライン上からpipコマンドでPySideをインストールしようとしたところ、下記のようなエラーを吐きました。

C:\Users\User>pip install pyside

Collecting pyside
  Using cached PySide-1.2.4.tar.gz
Installing collected packages: pyside
  Running setup.py install for pyside

(中略)

    running install
    running build
    Python architecture is 64bit
    nmake not found. Trying to initialize the MSVC env...
    Searching MSVC compiler version 10.0
    error: Failed to find the MSVC compiler version 10.0 on your system.

で、どうすれば良いかというと、ここ(Index of /official_releases/pyside)から自分の環境に合った.whlファイルをダウンロードし、.whlファイルを対象に直接インストールすればエラーの回避が可能です。

C:\Users\User>pip install C:\Users\User\Downloads\PySide-1.2.4-cp34-none-win_amd64.whl

Processing c:\users\User\downloads\pyside-1.2.4-cp34-none-win_amd64.whl
Installing collected packages: PySide
Successfully installed PySide-1.2.4

エラー現象としてはなんてことなく、元々pipはビルドしてインストールする仕組みなのに対し、Pythonコードではない(C++かな?)PySideは、ビルドしてインストールするためにC++コンパイラーが必要だと。このあたり環境整備すればうまくいくのでしょうが、面倒なので既にビルド済みのパッケージングされたバイナリファイル(**.whl)を使いましょうというお話でした。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0