离线安装wxpython

前言

由于工作环境,我的工作机是在离线环境下的,没法连接外网。但是自己又想学习一下wxpython,只好自己手动离线安装,本来以为很简单的,但是实际上。。。一言难尽。

基本环境:python pip easy_install

安装python2.7

直接下载msi数据包安装,如果无法识别安装,那么:

  • 1、确定msi数据包的完整性,包括大小、格式;

  • 2、确定开启开启windows installer:win + R --> 输入Services.msc --> 找到windows installer --> 左侧手动启用

python3.X 安装更为简单,直接双击.exe文件安装即可,且都需要选定添加环境变量。

安装wxpython

1、下载

下载地址:https://pypi.org/project/wxPython/4.0.1/#files

选择对应的文件进行安装,我的选择是: wxPython-4.0.1-cp27-cp27m-win_amd64.whl

其中:

cp27 表示 python2.7

win_amd64 表示 windows 64位

在这之外:win32 表示 32位

2、安装

将下载好的wxpython**.whl文件转移到python安装路径下的Scripts目录下,我的是:C:\Python27\Scripts

然后打开cmd或者powershell,切换到该目录下:

PS C:\User\Yanta> cd C:\Python27\Scripts

执行命令 pip install wxPython-4.0.1-cp27-cp27m-win_amd64.whl ,此时会报错:wxPython-4.0.1-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.

PS C:\Python27\Scripts> pip install .\wxPython-4.0.1-cp27-cp27m-win_amd64.whl
wxPython-4.0.1-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.

此时可以尝试使用easy_install安装,结果提示缺少 six 包。

PS C:\Python27\Scripts> .\easy_install-2.7.exe .\wxPython-4.0.1-cp27-cp27m-win_amd64.whl
Processing wxPython-4.0.1-cp27-cp27m-win_amd64.whl
c:\python27\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
c:\python27\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
c:\python27\lib\site-packages\setuptools\pep425tags.py:99: RuntimeWarning: Config variable 'Py_UNICODE_SIZE' is unset, Python ABI tag may be incorrect
sys.version_info < (3, 3))) \
Installing wxPython-4.0.1-cp27-cp27m-win_amd64.whl to c:\python27\lib\site-packages
writing requirements to c:\python27\lib\site-packages\wxPython-4.0.1-py2.7-win-amd64.egg\EGG-INFO\requires.txt
Adding wxPython 4.0.1 to easy-install.pth file
Installing wxdemo-script.py script to c:\python27\Scripts
Installing wxdemo.exe script to c:\python27\Scripts
Installing img2png-script.py script to c:\python27\Scripts
Installing img2png.exe script to c:\python27\Scripts
Installing pyslices-script.py script to c:\python27\Scripts
Installing pyslices.exe script to c:\python27\Scripts
Installing img2py-script.py script to c:\python27\Scripts
Installing img2py.exe script to c:\python27\Scripts
Installing pyslicesshell-script.py script to c:\python27\Scripts
Installing pyslicesshell.exe script to c:\python27\Scripts
Installing wxget-script.py script to c:\python27\Scripts
Installing wxget.exe script to c:\python27\Scripts
Installing helpviewer-script.py script to c:\python27\Scripts
Installing helpviewer.exe script to c:\python27\Scripts
Installing pyshell-script.py script to c:\python27\Scripts
Installing pyshell.exe script to c:\python27\Scripts
Installing pycrust-script.py script to c:\python27\Scripts
Installing pycrust.exe script to c:\python27\Scripts
Installing wxdocs-script.py script to c:\python27\Scripts
Installing wxdocs.exe script to c:\python27\Scripts
Installing pywxrc-script.py script to c:\python27\Scripts
Installing pywxrc.exe script to c:\python27\Scripts
Installing img2xpm-script.py script to c:\python27\Scripts
Installing img2xpm.exe script to c:\python27\Scripts Installed c:\python27\lib\site-packages\wxpython-4.0.1-py2.7-win-amd64.egg
Processing dependencies for wxPython==4.0.1
Searching for six
Reading https://pypi.python.org/simple/six/
Download error on https://pypi.python.org/simple/six/: [Errno 11004] getaddrinfo failed -- Some packages may not be found!
Couldn't find index page for 'six' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno 11004] getaddrinfo failed -- Some packages may not be found!
No local packages or working download links found for six
error: Could not find suitable distribution for Requirement.parse('six')

然后安装 six ,下载地址:https://pypi.org/project/six/#files

选择 six-1.11.0-py2.py3-none-any.whl ,一样拷贝到C:\Python27\Scripts下,使用pip安装:

PS C:\Python27\Scripts> .\easy_install-2.7.exe .\six-1.11.0-py2.py3-none-any.whl
Processing six-1.11.0-py2.py3-none-any.whl
c:\python27\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
c:\python27\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
c:\python27\lib\site-packages\setuptools\pep425tags.py:99: RuntimeWarning: Config variable 'Py_UNICODE_SIZE' is unset, Python ABI tag may be incorrect
sys.version_info < (3, 3))) \
Installing six-1.11.0-py2.py3-none-any.whl to c:\python27\lib\site-packages
Adding six 1.11.0 to easy-install.pth file Installed c:\python27\lib\site-packages\six-1.11.0-py2.7.egg
Processing dependencies for six==1.11.0
Finished processing dependencies for six==1.11.0

此时再次使用easy_install安装wxpython即可:

PS C:\Python27\Scripts> .\easy_install-2.7.exe .\wxPython-4.0.1-cp27-cp27m-win_amd64.whl
Processing wxPython-4.0.1-cp27-cp27m-win_amd64.whl
c:\python27\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
c:\python27\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
c:\python27\lib\site-packages\setuptools\pep425tags.py:99: RuntimeWarning: Config variable 'Py_UNICODE_SIZE' is unset, Python ABI tag may be incorrect
sys.version_info < (3, 3))) \
removing 'c:\python27\lib\site-packages\wxPython-4.0.1-py2.7-win-amd64.egg' (and everything under it)
Installing wxPython-4.0.1-cp27-cp27m-win_amd64.whl to c:\python27\lib\site-packages
writing requirements to c:\python27\lib\site-packages\wxPython-4.0.1-py2.7-win-amd64.egg\EGG-INFO\requires.txt
wxPython 4.0.1 is already the active version in easy-install.pth
Installing wxdemo-script.py script to c:\python27\Scripts
Installing wxdemo.exe script to c:\python27\Scripts
Installing img2png-script.py script to c:\python27\Scripts
Installing img2png.exe script to c:\python27\Scripts
Installing pyslices-script.py script to c:\python27\Scripts
Installing pyslices.exe script to c:\python27\Scripts
Installing img2py-script.py script to c:\python27\Scripts
Installing img2py.exe script to c:\python27\Scripts
Installing pyslicesshell-script.py script to c:\python27\Scripts
Installing pyslicesshell.exe script to c:\python27\Scripts
Installing wxget-script.py script to c:\python27\Scripts
Installing wxget.exe script to c:\python27\Scripts
Installing helpviewer-script.py script to c:\python27\Scripts
Installing helpviewer.exe script to c:\python27\Scripts
Installing pyshell-script.py script to c:\python27\Scripts
Installing pyshell.exe script to c:\python27\Scripts
Installing pycrust-script.py script to c:\python27\Scripts
Installing pycrust.exe script to c:\python27\Scripts
Installing wxdocs-script.py script to c:\python27\Scripts
Installing wxdocs.exe script to c:\python27\Scripts
Installing pywxrc-script.py script to c:\python27\Scripts
Installing pywxrc.exe script to c:\python27\Scripts
Installing img2xpm-script.py script to c:\python27\Scripts
Installing img2xpm.exe script to c:\python27\Scripts Installed c:\python27\lib\site-packages\wxpython-4.0.1-py2.7-win-amd64.egg
Processing dependencies for wxPython==4.0.1
Finished processing dependencies for wxPython==4.0.1

3、测试

安装过后测试一下,是否可以导入wx包:

PS C:\Python27\Scripts> py -2
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx

4、NOTE

本机安装有python2.7和3.6两个版本,使用py -2 和py -3分别指向2.7和3.6,在python脚本中使用:

#!/user/bin/env python2

#!/user/bin/env python3

分别指定即可。

离线安装wxpython的更多相关文章

  1. 如何离线安装python的whl库

    对于使用公司内网环境办公的人来说,可能无法使用pip install 命令安装python的whl库.对于这种情况,我们可以用以下的方法安装一个whl库. 1 下载whl文件,下载时注意,whl文件的 ...

  2. SharePoint 2016 必备组件离线安装介绍

    前言 SharePoint 必备组件安装,一直以来都是SharePoint安装过程中的最大的坑,尤其是不能联网的服务器.博主在这里简单介绍一下离线安装过程,并附组件包下载以及安装命令,并且在windo ...

  3. MYSQL离线安装

    由于MySQL的广泛应用,MySQL的安装也就成了大家经常会碰到的问题.并且由于不是所有机器都可连接外网,所以MySQL的离线安装显得比较重要.而本文旨在介绍CentOS6.6下离线安装MySQL. ...

  4. VS2010+Qt5.4.0 环境搭建(离线安装)

    原创作者:http://blog.csdn.net/solomon1558/article/details/44084969 前言 因项目需要Qt开发GUI,我根据网上资料及自己的经验整理了搭建vs2 ...

  5. 离线安装 Python 2.7, paramiko 和 tornado

    无非就是离线安装, 步骤比较繁琐, 记录一下. 需求很简单, 一个离线安装的 Python, 能跑 tornado 和 paramiko 1. 离线安装 Python 2.7 .tgz cd Pyth ...

  6. npm包与gem包--在线&离线安装

    目录 NPM 在线 离线 GEM 在线 离线 NPM NPM,即为Node的包管理工具,官网为 https://www.npmjs.com/,我们可以在站内搜索所需要的NPM包,了解相关的使用规则 安 ...

  7. Windows 8 下离线安装。net Framework 3.5

    Windows 8 下安装.net Framework 3.5 1)可以将直接双击ISO (或放入光盘/U盘)(安装文件在F盘) 2)使用管理员权限运行命令行程序 3)dism.exe /online ...

  8. Xamarin Mono For Android 4.6.07004 完整离线安装破解版(C#开发Android、IOS工具)

      Xamarin是由Miguel de Icaza成立的一家新的独立公司,目的是给Mono一个继续奋斗的机会.Mono for Android (原名:MonoDroid)可以让开发人员使用 Mic ...

  9. nexus离线安装索引及一些问题

    安装私服~~~ 整体流程: 服务器安装私服 配置私服(主要是安装索引) 本地maven配置指向私服 安装私服 win & linux 网上教程很多,不在阐述: 配置私服(及安装index) 1 ...

随机推荐

  1. Oracle分组函数之CUBE魅力

    Oracle的CUBE与ROLLUP功能很相似,也是在数据统计分析领域的一把好手. 关于ROLLUP的查询统计功能请参考文章<Oracle分组函数之ROLLUP魅力>(http://www ...

  2. 【研究】Struts2-052漏洞

    漏洞描述: CVE-2017-9805 2017年9月5日,Apache Struts官方发布最新的安全公告称,Apache Struts 2.5.x的REST插件存在远程代码执行高危漏洞,漏洞编号为 ...

  3. mysql远程连接详细配置

    2018-11-06 CentOS 配置MySQL允许远程登录 Mysql为了安全性,在默认情况下用户只允许在本地登录,可是在有此情况下,还是需要使用用户进行远程连接,因此为了使其可以远程需要进行如下 ...

  4. PIE SDK去相关拉伸

    1.算法功能简介 由于高度相关的数据集经常生成十分柔和的彩色图像,因此经常使用 去相关拉伸工具来体消除多光谱数据集中的高度相关性, 从而生成一幅色彩亮丽的彩色合成图像.去相关拉伸需要 3 个输入波段, ...

  5. Java基础22-Static关键字

    1.static关键字 public class Test{ public static void main(String[] args){ Persion p1=new Persion(); Per ...

  6. LeetCode 200.岛屿的个数

    给定一个由 '1'(陆地)和 '0'(水)组成的的二维网格,计算岛屿的数量.一个岛被水包围,并且它是通过水平方向或垂直方向上相邻的陆地连接而成的.你可以假设网格的四个边均被水包围. 示例 1: 输入: ...

  7. Nginx设置日志分割方法

    目标:nginx cronolog日志分割配置文档,每分钟分割一次NGINX访问日志. 大体步骤如下: 1.nginx日志配置 access_log /var/log/nginx/access.log ...

  8. Python的静态方法和类成员方法都可以被类或实例访问,两者概念不容易理清,但还是有区别的

    转:http://www.cnblogs.com/2gua/ Python的静态方法和类成员方法都可以被类或实例访问,两者概念不容易理清,但还是有区别的: 1)静态方法无需传入self参数,类成员方法 ...

  9. RegExp正则表达式内容

    在线测试工具:http://leaverou.github.io/regexplained/ RegExp 对象表示正则表达式,它是对字符串执行模式匹配的强大工具. 直接量语法:/pattern/at ...

  10. Nginx的各种报错总结

    1.Nginx安装过程报错 错误一:软件依赖包未正确安装问题---PCRE依赖包没有安装 ./configure: error: the HTTP rewrite module requires th ...