Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8266423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:09:17+00:00 2026-06-08T05:09:17+00:00

In the past, I’ve used pycompiler (or ‘pyinstaller’) to compile my programs that use

  • 0

In the past, I’ve used pycompiler (or ‘pyinstaller’) to compile my programs that use the PyQt4 framework to executable code, simply because py2exe.
I have switched computers recently and have not yet managed to compile my PyQt4 programs on it!

In this computer, I have set an environment variable %pycompile% that has the directory of the pyinstaller.py file.

Here is the code I plug into the cmd.exe, that is working with python code NOT IMPORT PYQT4.

python %pycompile% --noconsole myscript.pyw

However, when I try to compile my PyQt4 based program, I get a Syntax Error that originates (by my interpretation) from inside a python file imported by pyinstaller.py when trying to compile PyQt4 programs.
“exec_ = exec”

E:\ChemCalc ULTIMATE\ChemCalc ULTIMATE>python %pycompile% Penny.pyw
I: skip Configure.py, use existing config C:\Python27\PyCompile\config.dat
wrote E:\ChemCalc ULTIMATE\ChemCalc ULTIMATE\Penny.spec
I: Dependent assemblies of C:\Python27\python.exe:
I: x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none
checking Analysis
building Analysis because outAnalysis0.toc non existent
running Analysis outAnalysis0.toc
Analyzing: C:\Python27\PyCompile\support\_mountzlib.py
Analyzing: C:\Python27\PyCompile\support\useUnicode.py
Analyzing: Penny.pyw
Syntax error in exec_py3.py
('invalid syntax', ('exec_py3.py', 1, 12, 'exec_ = exec\n'))
Traceback (most recent call last):
  File "C:\Python27\PyCompile\pyinstaller.py", line 187, in <module>
    main(parser)
  File "C:\Python27\PyCompile\pyinstaller.py", line 76, in main
    run_build(opts, args, spec_file)
  File "C:\Python27\PyCompile\pyinstaller.py", line 52, in run_build
    Build.main(spec_file, configfilename=opts.configfile)
  File "C:\Python27\PyCompile\Build.py", line 1472, in main
    build(specfile)
  File "C:\Python27\PyCompile\Build.py", line 1429, in build
    execfile(spec)
  File "E:\ChemCalc ULTIMATE\ChemCalc ULTIMATE\Penny.spec", line 3, in <module>
    pathex=['E:\\ChemCalc ULTIMATE\\ChemCalc ULTIMATE'])
  File "C:\Python27\PyCompile\Build.py", line 347, in __init__
    self.__postinit__()
  File "C:\Python27\PyCompile\Build.py", line 298, in __postinit__
    self.assemble()
  File "C:\Python27\PyCompile\Build.py", line 416, in assemble
    analyzer.analyze_script(script)
  File "C:\Python27\PyCompile\mf.py", line 572, in analyze_script
    return self.analyze_r('__main__')
  File "C:\Python27\PyCompile\mf.py", line 466, in analyze_r
    newnms = self.analyze_one(name, nm, imptyp, level)
  File "C:\Python27\PyCompile\mf.py", line 525, in analyze_one
    mod = self.doimport(nm, ctx, fqname)
  File "C:\Python27\PyCompile\mf.py", line 587, in doimport
    mod = parent.doimport(nm)
  File "C:\Python27\PyCompile\mf.py", line 761, in doimport
    mod = self.subimporter.getmod(nm)
  File "C:\Python27\PyCompile\mf.py", line 355, in getmod
    mod = owner.getmod(nm)
  File "C:\Python27\PyCompile\mf.py", line 117, in getmod
    co = compile(string.replace(stuff, "\r\n", "\n"), py[0], 'exec')
  File "exec_py3.py", line 1
    exec_ = exec
               ^
SyntaxError: invalid syntax

I am using the same build (216) of pycompile that I used to on my old computer. They both run 32 bit Windows with 32 bit python 2.7.2.

All help wanted!
(I’m freaking out that my MASSIVE programming project can’t be compiled!)

I’ve read quite a few Stack questions about pyinstaller errors with PyQt, but not my particular error!

Thanks!

My code begins with:

import sys
import getpass
import hmac
import random
import shutil
from PyQt4 import QtGui, QtCore
from RegMenu import Ui_RegristrationMenu
from ChemWindow import Ui_ChemWindow
from ReactionClass import ReactionElement
from StoichUnitSelectionClass import Ui_StoichUnitSelection
from VisualTool import Ui_Aesthetics_Tool
import decimal  
import sympy  
import math

and ends with:

sys.exit(ApplicationRun.exec_())

python 2.7.2 (32 bit)
pycompile build (216)
PyQt4 (4.5)
Windows 7 (32 bit)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:09:19+00:00Added an answer on June 8, 2026 at 5:09 am

    Fixed as by Avaris’ shared suggestion.
    http://code.google.com/p/mpmath/issues/detail?id=204

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the past, I used swiftsuspenders that is an actionscript 3 IoC controller. Basically
In the past I've used precompiled headers in VC to speed up compile times
In the past when I have used Oracle and the Entity Framework, database-first, I've
In past, I am using Listview and using below code can show a particular
In the past I've heard that it can be dangerous to rename the Plone
In the past, when I've had to compile something on Snow Leopard (or any
In the past it was my understanding that the Lat/Lon of an airport had
In the past I have used MAPISendMail to launch Outlook (or whatever the desired
From past few days I'm trying to develop a regex that fetch all the
These past few days I've been working toward converting my PHP code base from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.