How to change python version for use with pyinstaller

后端 未结 5 947
遥遥无期
遥遥无期 2021-02-06 00:25

I am trying to convert a .py file to an exe. My file, hello.py, reads:

print \"Hello, World!\"

I am currently trying to use pyinstaller. Howeve

5条回答
  •  孤城傲影
    2021-02-06 01:31

    I ran two a couple things. If you uninstall python3, it works with python2. If you have python3 installed (and it is the primary), and have pyinstaller installed in python3, it wont work (python3 pyinstaller used). If you have python3 installed, but do not have it installed in python3 or uninstalled it (pip3 uninstall pyinstaller), pyinstaller works.

    Checking the environmental variables (windows 10) PATH had python3 first. This may be the issue and may not be resolved because it is checking python3 directories first, and picks up pyinstaller for python3. pyinstaller does not check the file either (#!/usr/env/bin python2).

    Unless pyinstaller puts an option relating to this issue, there may be no solution short of uninstalling pyinstaller from python3 temporarily.

    note could also use py2exe, using py2exe for python2, pyinstaller for python3

提交回复
热议问题