最近需要在 Linux 以及 windows 上 打包 python 程式 將其編成一個可執行檔
當時很自然想到使用 pyinstaller
conda create -n test python=3 # 當時這個指令會安裝 python 3.6 pip install pyinstaller ... pyinstaller --onefile path/to/my/file.py
結果在 windows 遇到與這篇文章 一模一樣的 問題
pyinstaller exe not running - No module named Pyside
解決的方式是 先退回 python 3.4
conda create -n test python=3 # 當時這個指令會安裝 python 3.6 pip install pyinstaller ... pyinstaller --onefile path/to/my/file.py
conda yml
name: stdfpy34 channels: - defaults dependencies: - mkl=2017.0.3=0 - numpy=1.11.3=py34_0 - pandas=0.19.2=np111py34_1 - pip=9.0.1=py34_1 - python=3.4.5=0 - python-dateutil=2.6.0=py34_0 - pytz=2017.2=py34_0 - setuptools=27.2.0=py34_1 - six=1.10.0=py34_0 - vs2010_runtime=10.00.40219.1=2 - wheel=0.29.0=py34_0 - pip: - click==6.7 - future==0.16.0 - futures==3.1.1 - pyinstaller==3.2.1 - pypiwin32==219 - pyspin==1.1.1 - stdf==0.2.2 prefix: C:\Users\ming\AppData\Local\Continuum\Anaconda3\envs\stdfpy34