Python 2.7 script compiling to .exe that uses many packages, including Matplotlib and PyQt4

吃可爱长大的小学妹 提交于 2019-12-25 08:19:44

问题


I'm trying to compile a Python 2.7 script that imports the following packages:

import easygui as EG

import numpy as np
import pandas

from skimage import data
from skimage import measure

import cv2

import matplotlib.pyplot as plt
from matplotlib.widgets import Button

import ntpath
import os
import time

# Packages for progress bar
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtCore import pyqtSlot,SIGNAL,SLOT
  • easygui
  • numpy
  • pandas
  • skimage
  • opencv (cv2)
  • matplotlib
  • numpy
  • ntpath
  • os
  • time
  • sys
  • PyQt4.QtGui
  • PyQt4.QtCore

All of my sub-functions are in the one "GUI.py" script, and runs perfectly when I use the normal IDE, but I can't seem to get it to compile properly.

I have tried to use cx_freeze as described here, and pyInstaller through what was described here. Both did compile and a "GUI.exe" file was made, but it did not work when I tried to run it.

If anyone has any suggestions, I would greatly appreciate it.

I'm using Python 2.7 Win 64 and I use Anaconda 2.

来源:https://stackoverflow.com/questions/40795334/python-2-7-script-compiling-to-exe-that-uses-many-packages-including-matplotli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!