离线安装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. hdu 2570 贪心

    贪心的经典题型 该死的精度问题,WA了好几次,以后能用乘的绝不用除!! #include<iostream> #include<algorithm> #include<c ...

  2. telnet出现Connection closed by foreign host

    2018-10-26 执行命令: telnet smtp.exmail.qq.com 出现信息: [root@pengman Desktop]# telnet Tring Connected to 1 ...

  3. poj1862

    一.题意:两个物体m1.m2相撞后会变成一个物体,这个物体的重量会变成2*sqrt(m1*m2).有n个物体,假设只会发生两两相撞,求最后剩下的最小重量. 二.思路:简单的贪心.越大的数开越多的次方, ...

  4. Oracle DG --检查

    检查DG是否同步 01,  查看主备可切换状态 select switchover_status from v$database;select db_unique_name,open_mode,dat ...

  5. linux中Python源码安装和配置

    安装 首先获取安装包,此处版本为3.7 wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz 解压 tar xvf Python- ...

  6. java与C语言在字符串结束符上的区别

    综述:在C语言中字符串或字符数组最后都会有一个额外的字符‘\0’来表示结束,而在java语言中没有结束符这一概念.具体见下面分析. 1. C 语言 在C语言中字符串和字符数组基本上没有区别,都需要结束 ...

  7. Tortoise SVN 快速操作手册

    1.库的存储结构 版本库文件结构如图所示: Code文件夹为源码文件夹,doc为文档目录文件夹, 1.1 branch:分枝文件夹 当多个人合作,可能有这样的情况出现:John突然有个想法,跟原先的设 ...

  8. SQL Server 2008 SQL2012 SQL2014 收缩日志 清空删除大日志文件

    SQL2008 SQL2012 SQL2014 的收缩日志 由于SQL2008对文件和日志管理进行了优化,所以以下语句在SQL2005中可以运行但在SQL2008中已经被取消:(SQL2005)Bac ...

  9. Apache Beam的目标

    不多说,直接上干货! Apache Beam的目标 统一(UNIFIED) 基于单一的编程模型,能够实现批处理(Batch processing).流处理(Streaming Processing), ...

  10. AQS的数据结构及实现原理

    接下来从实现角度来分析同步器是如何完成线程同步的.主要包括:同步队列.独占式同步状态获取与释放.共享式同步状态获取与释放以及超时获取同步状态等. 1.同步队列 同步器依赖内部的一个同步队列来完成同步状 ...