LoginSignup
5
7

More than 5 years have passed since last update.

pyinstaller ビルド時の”Cannot find existing PyQt5 plugin directories”

Posted at

1 環境

Anaconda環境でpyinstallerをインストールするには以下のサイトがわかりやすく参考になります。ちなみに今回の環境はWindows10、pythonのバージョンは3.6です。

Pyhtonのスクリプトをコマンド1つで実行ファイル(.exe)化する

pyinstallerのインストールはなんの問題もなくうまくいったのですが、pythonのコードをexe化をしようとしたところ

Cannot find existing PyQt5 plugin directories

のエラーが発生。

2 対策

PyQt5が見つからない場合の対策も上記のサイトに紹介されているのですが、うまくいきません。

PyQt5をconda installでインストールしようとしましたが、以下のようにはじかれてしまいます。

UnsatisfiableError: The following specifications were found to be in conflict:
- pyqt5 -> python=3.5
- python=3.6
Use "conda info " to see the dependencies for each package.

python3.6に対応してないということでしょうか?
先ほどのエラーをよくみると、以下のパスをチェックしろと書いてあります。

Exception:
Cannot find existing PyQt5 plugin directories
Paths checked: C:/Miniconda3/conda-bld/qt_1535195524645/_h_env/Library/plugins

それで指示されている「/Miniconda3/.../plugins」フォルダを作成し、

Anacondaインストールフォルダ\envs\仮想環境名\Library\plugins\

にあるplatformsフォルダをフォルダごとコピー

pyinstaller --onefile hogehoge.py

再ビルドで無事にexeファイルが作成できました。

5
7
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
5
7