window 下Python环境搭建

一 。安装Python

       python官方网站:http://www.python.org下载python的安装包,运行安装即可。

      python安装是否成功,cmd打开命令行输入 python 命令,显示版本信息即安装成功。

     python的安装目录添加到pth系统变量中即可

二。开发工具

     下载PyCharm 开发工具,安装即可。

三。打包编译工具

      下载 PyInstaller 编译工具,官方网站:http://www.pyinstaller.org/index.html   github地址:https://github.com/pyinstaller/pyinstaller

      快速安装方法:

   打开 cmd ,输入 pip install pyinstaller 命令自动安装完成。

  输入 pyinstaller yourprogram.py 测试是否成功。

如果报以下错误信息:

 File "c:\users\bbk-370\appdata\local\programs\python\python36\lib\site-package
s\PyInstaller\lib\modulegraph\modulegraph.py", line 2731, in get_operation_arg_n
ame
    return module_code_object.co_names[co_names_index]
IndexError: tuple index out of range

因为官网目前的版本是3.2.1 只支持到python3.5 pyinstaller3.3 还没有发行。

从官网源码里下载 https://github.com/pyinstaller/pyinstaller 替换掉 Python安装目录Python\Python36\Lib\site-packages\PyInstaller 下面的pyinstaller即可。


猜你喜欢

转载自blog.csdn.net/zhldt2008/article/details/69958833