[虽然iOS 5.0版本之后加入了ARC机制,由于相互引用关系比较复杂时,内存泄露还是可能存在。所以了解原理很重要。这里讲述在没有ARC的情况下,如何使用Instruments来查找程

cx_Freeze是一个打包python为exe的好库,可是安装后打包一些程序后不能运行

打开的时候出现:

python\lib\site-packages\cx_Freeze\freezer.py:574: UserWarning: Duplicate name: 'importlib/__init__.pyc'

outFile.writestr(zinfo, data)

然后打开cmd,在命令行中运行exe文件

错误如下:

Traceback (most recent call last):

File "C:\Python34\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in

exec(code, m.__dict__)

File "forecast.py", line 4, in

File "C:\Python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2214, in _find_and_load

File "C:\Python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2189, in _find_and_load_unlocked

File "C:\Python\32-bit\3.4\lib\importlib\_bootstrap.py", line 321, in _call_with_frames_removed

File "C:\Python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2214, in _find_and_load

File "C:\Python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2203, in _find_and_load_unlocked

File "C:\Python\32-bit\3.4\lib\importlib\_bootstrap.py", line 1191, in _load_unlocked

File "C:\Python\32-bit\3.4\lib\importlib\_bootstrap.py", line 1161, in _load_backward_compatible

AttributeError: 'module' object has no attribute '_fix_up_module'

原因是有bug,歪果仁说版本Bug,正在试图解决,实际上已经解决了。

看我的:

查看自己的python位数:

>>> import sys, platform

>>> platform.architecture()

('64bit', 'WindowsPE')

下载对应版本:

当然,先要卸载我之前安装的msi,如下:

下载之后的库是zip结尾的,改成whl结尾

然后打开cmd,转到该文件目录,使用:

然后转到python安装目录下的cx-Freeze实例去试试成不成功,如图:

[由于发现原创文章,在未署名作者及出处的情况下被转载。在以后所有的原创文章开头我都会写明作者和出处。希望朋友们以后在转载本博客原创博文时注意标明文章作者及出处。

命令是:

python setup.py build

最后运行一下:

完全没问题,因为只是缺少wx包,我没装。

而最简单的setup.py文件可以在这里找,如图:

# -*- coding: utf-8 -*-

# A very simple setup script to create a single executable

#

# hello.py is a very simple 'Hello, world' type script which also displays the

# environment in which the script runs

#

# Run the build process by running the command 'python setup.py build'

#

# If everything works well you should find a subdirectory in the build

# subdirectory that contains the files needed to run the script without Python

from cx_Freeze import setup, Executable

executables = [

Executable('hello.py')

]

setup(name='hello',

version='0.1',

description='Sample cx_Freeze script',

executables=executables

)

此时已经结束了,好愉快。

其实,我还有很多东西需要写成博文,没动力,啊呀。

可以在我的百度云上下载:一只尼玛

我Build了一下,发现了,我是要用python画图的:

No module named 'matplotlib.backends.backend_tkagg'

看来解决了一个问题,还要再解决一个。

I've seen this before, also on openSUSE (12.3). The fix is to edit the default matplotlibrc file.

Here's how you find where the default matplotlibrc file lives, and where it lives on my machine:

>>> import matplotlib

>>> matplotlib.matplotlib_fname()

'/usr/lib64/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc'

The backend setting is the first configuration option in this file. Change it from TkAgg to Agg, or to some other backend you have installed on your system. The comments in the matplotlibrc file list all backends supported by matplotlib.

The backend specified in this file is only the default; you can still change it at runtime by adding the following two lines, before any other matplotlib import:

import matplotlib

matplotlib.use("Agg") # or whichever backend you wish to use

意思就是说你可以把site-packages/matplotlib/mpl-data/matplotlibrc里面的第一个配置的TkAgg改为Agg,或者在程序的最开始加入以下:

import matplotlib

matplotlib.use("Agg") # or whichever backend you wish to use

改了之后可以打包了,可是没有图出来,卧槽,明明有这些文件,难道没有安装Tk包

ValueError: Unrecognized backend string "gdkagg": valid strings are ['gdk', 'GTK', 'TkAgg', 'svg', 'Qt4Agg', 'ps', 'emf', 'pdf', 'template', 'agg', 'GTK3Agg', 'cairo', 'pgf', 'GTKAgg', 'nbAgg', 'CocoaAgg', 'WXAgg', 'WX', 'GTKCairo', 'GTK3Cairo', 'WebAgg', 'Qt5Agg', 'MacOSX']

matplotlib.use("gdk")

一个个试着看!!!

[我的系统是ubuntu6.06,最近新装好的mysql在进入mysql工具时,总是有错误提示:# mysql -uroot -pEnter password:ERROR 1045 (28000): Access denied for use]

ios python3闪退_解决Python3 cx_Freeze打包闪退/无法执行以及No module named 'matplotlib.backends.backend_tkagg'...相关推荐

  1. arduino win10闪退_解决Win10天气应用闪退的两种方法

    Windows系统中都自带天气应用,但是安装了Win10系统后,就发现,打开天气应用出现闪退的情况,其他应用都正常,这要怎么解决呢?下面小编告诉大家解决Win10天气应用闪退的两种方法. 方法一 1. ...

  2. autocad2014 第二次打开闪退_解决win10下autocad2014闪退的修复方法

    Win10下AutoCAD 2014打开出现闪退怎么解决?有用户反映经过一次系统更新后,发现AutoCAD 2014打开会出现闪退的情况.下面和大家分享一下Win10下AutoCAD 2014打开出现 ...

  3. python3输出中文_解决Python3用PIL的ImageFont输出中文乱码的问题

    今天在用python3+ImageFont输出中文时,结果显示乱码 # coding:utf-8 from PIL import Image, ImageDraw, ImageFont image= ...

  4. python3 文本处理_解决python3 写入中文文本查看为乱

    在python3中我们直接使用 f = open("file","w") 然后写入中文时,我们先关闭然后再查看,时没问题的,但是如果我们在文本里面查看会正常的, ...

  5. python2.7环境下“No module named matplotlib.pyplot”的解决办法

    写在这里的初衷,一是备忘,二是希望得到高人指点,三是希望能遇到志同道合的朋友. 目录 一.问题 二.根本原因 三.解决办法 一.问题 // An highlighted block import ma ...

  6. 【转】modulenotfounderror: no module named ‘matplotlib._path‘问题的解决

    [转]modulenotfounderror: no module named 'matplotlib._path'问题的解决 参考文章: (1)[转]modulenotfounderror: no ...

  7. modulenotfounderror: no module 或modulenotfounderror: no module named 'matplotlib._path' 原因详解及解决办法

    环境:Ubuntun14.04LTS +Anaconda4.2+tensorflow1.2+pycharm community2017.3.3 运行.py文件时,1.出现ImportError: No ...

  8. ModuleNotFoundError: No module named ‘matplotlib‘ 解决办法

    问题:ModuleNotFoundError: No module named 'matplotlib' 解决办法: round 1:打开PyCharm,点击File->Settings,点击弹 ...

  9. python3中map函数_解决Python3下map函数的显示问题

    map函数是Python里面比较重要的函数,设计灵感来自于函数式编程.Python官方文档中是这样解释map函数的: map(function, iterable, ...) Return an it ...

最新文章

  1. 用一个实际例子理解Docker volume工作原理
  2. IT大佬整理的Python机器学习十大算法案例
  3. Java虚拟机一览表
  4. Power BI统一报表平台演示环境发布
  5. stm32数码管显示实时时间并有闹钟功能
  6. kettle清洗mysql数据_ETL工具Kettle使用以及与Java整合实现数据清洗
  7. 素数 [2008年北京航空航天大学计算机研究生机试真题]
  8. 前格式 直接将转换为当_如何将word转化为PDF格式?1分钟学会文档转换
  9. linux常用快捷键大全
  10. 怎样用比较器实现信号的衰减和饱和_小器件大功用之变频器输入滤波器
  11. ubantu20刷新DNS缓存的命令
  12. win10各个版本激活码到期了
  13. 小米手机微信指纹支付上传服务器吗,小米MIUI支持微信指纹支付吗 小米MIUI微信指纹支付【图文】...
  14. 全基因组选择中准确性的影响因素
  15. 国内首部创业纪实电影《燃点》进校园:如何靠近成功的2%...
  16. 关于 Android 中 TabLayout 下划线适配文字长度解析(附清晰详细的源码解析)
  17. java applet编程_JavaApplet编程技巧
  18. 用Python爬取微信好友,原来他们是这样的人......
  19. Jest 单元测试快速入门
  20. beyond compare

热门文章

  1. Vue表单输入绑定(文本框和复选框)
  2. python之地基(一)
  3. 1111---9999的变换
  4. UVA103 dp基础题,DAG模型
  5. WPF采用MVVM模式(绑定:纯前台、命令:触发器绑定命令)
  6. [CTSC2008] 网络管理
  7. 从零开始——基于角色的权限管理01(补充)
  8. JavaScript正则表达式补充
  9. 07.用户控件弹窗提示后页面显示不正常;
  10. AAC Explicit or Implicit SBR PS issue