简体   繁体   English

cx_freeze AttributeError:模块'dis'没有属性'_unpack_opargs'

[英]cx_freeze AttributeError: module 'dis' has no attribute '_unpack_opargs'

I have been trying for quite some time now to make my Python program run on pc's that don't have python installed. 我已经尝试了很长时间,以使我的Python程序在未安装python的PC上运行。 I have issues because I'm using python 3.6.0. 我遇到了问题,因为我正在使用python 3.6.0。 In this post I am going to discuss a method I got from this video . 在这篇文章中,我将讨论从该视频中获得的一种方法。

The first thing I did, was install Python 3.5 and create a virtualenv for it, which I activated. 我做的第一件事是安装Python 3.5并为其创建了virtualenv,并激活了它。 You can see how I did that on the post I made earlier today . 您可以在今天早些时候发表的帖子中看到我的做法。 After I activated the environment, I used this command in cmd in the python 3.5 environment: pip install cx_Freeze . 激活环境后,我在python 3.5环境的cmd中使用了以下命令: pip install cx_Freeze It got installed with no errors. 它安装正确无误。 Then I made this setup.py file: 然后我制作了这个setup.py文件:

from cx_Freeze import setup, Executable

setup(name='vkv',
  version='0.1',
  description='Berekent de wortels van een vkv',
  executables = [Executable('vkv.py')])

The python file that I want to turn into a .exe file is called vkv.py . 我想将其转换为.exe文件的python文件称为vkv.py The vkv.py file and the setup.py file are both the only 2 files on this path: C:\\Users\\hp\\Desktop\\Code\\Python testing\\distr . vkv.py文件和setup.py文件都是该路径上仅有的两个文件: C:\\Users\\hp\\Desktop\\Code\\Python testing\\distr

Ok so now I only have to enter setup.py build in the command line in order to make the .exe file. 好的,现在我只需要在命令行中输入setup.py build即可生成.exe文件。 But when I do that, I get a bunch of lines, with an error on the last line: 但是当我这样做的时候,我得到了很多行,最后一行有错误:

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

Here is a screenshot of it: 这是它的屏幕截图: 在此处输入图片说明

Does anyone know what I did wrong? 有人知道我做错了吗? Is it something in the setup.py file, is it not setting up the virtualenv correctly? 它在setup.py文件中是否存在,是否未正确设置virtualenv? And does anyone know what this error means and how I can fix it? 有谁知道此错误的含义以及如何解决该错误?

You are dealing with an version of cx_freeze that has a bug that manifests itself for versions larger than 3.5.2 , this issue has already been reported here and fixed . 您正在处理的cx_freeze版本存在一个错误,该错误会在大于3.5.2版本中体现出来,此问题已在此处报告并解决

In short, a small change was introduced in Python 3.5.2 that cx_freeze failed to catch, now a check is made to work smoothly. 简而言之,在Python 3.5.2中引入了一个小的更改,使cx_freeze无法捕获,现在进行了检查以使其工作顺利。

In short, you'll need to update cx_freeze , you could either try pip install -U cx_freeze or get the source for it. 简而言之,您需要更新cx_freeze ,您可以尝试pip install -U cx_freeze或获取源代码。

ps Using Python 3.6 right now probably isn't the best idea since quite some changes were made and bugs might take a while to be caught and fixed. ps现在使用Python 3.6可能不是最好的主意,因为进行了许多更改,并且可能需要一些时间才能发现和修复错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError:使用CX_FREEZE构建Python 3.6可执行文件时,模块'dis'没有属性'_unpack_opargs' - AttributeError: module 'dis' has no attribute '_unpack_opargs' While Building Python 3.6 executable using CX_FREEZE Python,AttributeError:cx_Freeze 构建后,模块“google.cloud.bigquery”没有属性“Client” - Python, AttributeError: module 'google.cloud.bigquery' has no attribute 'Client' after cx_Freeze build windows cx_freeze 上的“AttributeError: 'NoneType' object 没有属性写入” - “AttributeError: ‘NoneType’ object has no attribute write” on windows cx_freeze 获取AttributeError:运行cx_Freeze可执行文件时,模块'tensorflow_estimator.python.estimator.api.estimator'没有属性'__file__' - Getting AttributeError: module 'tensorflow_estimator.python.estimator.api.estimator' has no attribute '__file__' when running a cx_Freeze executable Python Sklearn / Scikit和cx_freeze:模块“ sklearn.tree._criterion”没有属性“ Criterion” - Python Sklearn / Scikit & cx_freeze: module 'sklearn.tree._criterion' has no attribute 'Criterion' 将imaplib与cx_Freeze一起使用时,获取“模块'imaplib'没有属性'IMAP4_SSL'” - Getting “module 'imaplib' has no attribute 'IMAP4_SSL'” when using imaplib with cx_Freeze cx_Freeze属性错误:“列表”对象没有属性“项目” - cx_Freeze Attribute error: 'list' object has no attribute 'items' cx_freeze 模块依赖 - cx_freeze module dependency cx_Freeze 缺少模块 - cx_Freeze missing module cx_Freeze + curses:“ NoneType”对象没有属性“ fileno” - cx_Freeze + curses: 'NoneType' object has no attribute 'fileno'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM