简体   繁体   中英

pyinstaller exe not running - No module named Pyside

My program works fine if run from Python.

I am now packaging this into an exe using Pyinstaller.

pyinstaller --onefile path/to/my/file.py

I am able to run the exe and so is anyone else if Python is installed on their system.

If Python is not installed, when the exe is run through terminal this error is seen:

ImportError: No module named 'Pyside'

The program does not use this module. The only libraries it uses are:

os, sys, glob, selenium, PyQt4, warnings

Installing and importing Pyside is not an option (I have tried this) as I am using Python 3.5.

Why is the created exe looking for the PySide module on a system without Python but not on a system with Python installed? Thanks

EDIT 1

It appears the issue is with PyQt4 as the below program will crash but a program with any of the other modules will run on a system without Python.

"""
Created on Mon Jan  9 09:23:13 2017
@author: me
"""
import PyQt4
print("This program simply tests if a packaged\npython program runs on your system!\n")
input("Press Enter to exit...")

EDIT 2

An example of the terminal output when the program is built.

在此处输入图像描述

The resolution to this was to roll the Python version back to a 3.4 distribution.

Once the needed modules (PyQt4 and PyInstaller (v3.2)) were installed, PyInstaller was used without issue in the same way as before.

The resulting exe was able to run on both systems with and without Python with no errors.

Tracking of this issue for PyInstaller is here .

Thank you

或更新 Pyinstaller!))

pip install --upgrade pyinstaller

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM