New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cxfreeze module 'dis' has no attribute '_unpack_opargs' #225

Closed
anthony-tuininga opened this Issue Jan 11, 2017 · 11 comments

Comments

Projects
None yet
1 participant
@anthony-tuininga
Owner

anthony-tuininga commented Jan 11, 2017

Originally reported by: Anonymous


Trying to make an app out of a basic python script which doesn't use any external library and only uses the random library

cx_Freeze.version -> 5.0
sys.version -> '3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)]'

Traceback:

#!python

cxfreeze discord_blackjack.py --target-dir dist
Traceback (most recent call last):
  File "C:\Python35\Scripts\cxfreeze", line 5, in <module>
    main()
  File "C:\Python35\lib\site-packages\cx_Freeze\main.py", line 177, in main
    freezer.Freeze()
  File "C:\Python35\lib\site-packages\cx_Freeze\freezer.py", line 621, in Freeze
    self.finder = self._GetModuleFinder()
  File "C:\Python35\lib\site-packages\cx_Freeze\freezer.py", line 333, in _GetModuleFinder
    self.path, self.replacePaths)
  File "C:\Python35\lib\site-packages\cx_Freeze\finder.py", line 150, in __init__
    self._AddBaseModules()
  File "C:\Python35\lib\site-packages\cx_Freeze\finder.py", line 161, in _AddBaseModules
    self.IncludeModule("traceback")
  File "C:\Python35\lib\site-packages\cx_Freeze\finder.py", line 645, in IncludeModule
    namespace = namespace)
  File "C:\Python35\lib\site-packages\cx_Freeze\finder.py", line 310, in _ImportModule
    deferredImports, namespace = namespace)
  File "C:\Python35\lib\site-packages\cx_Freeze\finder.py", line 403, in _InternalImportModule
    parentModule, namespace)
  File "C:\Python35\lib\site-packages\cx_Freeze\finder.py", line 474, in _LoadModule
    self._ScanCode(module.code, module, deferredImports)
  File "C:\Python35\lib\site-packages\cx_Freeze\finder.py", line 544, in _ScanCode
    method = dis._unpack_opargs if sys.version_info[:2] >= (3, 5) \
AttributeError: module 'dis' has no attribute '_unpack_opargs'

@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 11, 2017

Original comment by Ivan Y (Bitbucket: klensy, GitHub: klensy):


Hi. Try to build this with python 3.5.2, looks like http://bugs.python.org/issue26881.

@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 13, 2017

Original comment by Chris Johnson (Bitbucket: silentorb, GitHub: silentorb):


So cx_Freeze does not support python 3.5.1?

@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 13, 2017

Original comment by Ivan Y (Bitbucket: klensy, GitHub: klensy):


Should be fixed in https://bitbucket.org/anthony_tuininga/cx_freeze/pull-requests/100.

@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 13, 2017

Original comment by Anthony Tuininga (Bitbucket: anthony_tuininga, GitHub: Unknown):


Thanks, Ivan.

@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 18, 2017

Original comment by OCG (Bitbucket: ornitcohen, GitHub: Unknown):


Hi I tried to build with 3.5.1 and with 3.5.2 and still the same error shows. what am i missing? I a beginner with python. and I need simple instructions.
thank you for any help

@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 18, 2017

Original comment by Ivan Y (Bitbucket: klensy, GitHub: klensy):


Hmm, should work with 3.5.2.

Can u build simple app (with this error) on python 3.5.2, run it and attach logs here?

@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 19, 2017

Original comment by OCG (Bitbucket: ornitcohen, GitHub: Unknown):


sorry i don't know what u mean by logs. and how to do that.
i have a small py file that runs. i created a setup.py file as instructed in a tutorial
the setup file looks like this:

from cx_Freeze import setup, Executable
setup(name='GALmerger.py',version='0.1',description='merge gal files', executables=[Executable('GALmerger.py')])

I put both files in the same directory
and run cmd from that directory by Shift + right click ---> open command window here

in cmd I type: python setup.py build (as instructed in the same tutorial)
and i get that messege

i have both python 3.5.1 64bit and 3.5.2 32bit (for which only i could install cx_freeze with)
does it help ?

@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 19, 2017

Original comment by Ivan Y (Bitbucket: klensy, GitHub: klensy):


Try:

  1. Remove all pythons.
  2. Install python 3.5.2 again.
  3. install cx_freeze and build your script.
@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 19, 2017

Original comment by OCG (Bitbucket: ornitcohen, GitHub: Unknown):


I'll try that
thank you!

@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 19, 2017

Original comment by OCG (Bitbucket: ornitcohen, GitHub: Unknown):


  • So this is what i did:
  • uninstalled all pythons and cx_freeze
  • restarted computer
  • installed again python 3.5.2 for 32 bit
  • could not install cx_freeze from website.
  • installed python 3.5.2 64 bit in addition
  • still could not install cx_freeze from website.
  • installed cx_freeze from cmd using pip install cx_freeze (ok)
  • tried " python setup.py build' and got a keyerror of 'TCL_LIBRARY'
@anthony-tuininga

This comment has been minimized.

Owner

anthony-tuininga commented Jan 19, 2017

Original comment by Ivan Y (Bitbucket: klensy, GitHub: klensy):


Better not mix python versions.

This:

#!txt

tried " python setup.py build' and got a keyerror of 'TCL_LIBRARY'

some other error, not

#!txt

AttributeError: module 'dis' has no attribute '_unpack_opargs'

as discussed at this topic.

About tcl error, look here and here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment