window 下Python環境搭建__Python

來源:互聯網
上載者:User

一 。安裝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即可。


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.