Installing PyInstaller on Mac

老子叫甜甜 提交于 2019-12-24 14:14:53

问题


I have not seen this issue in my google searches. I am trying to install PyInstaller on my work Mac which I do not have administrative access.

    $ pip install --user pyinstaller
    Collecting pyinstaller
    Requirement already satisfied: dis3 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
    Requirement already satisfied: setuptools in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
    Requirement already satisfied: macholib>=1.8 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
    Requirement already satisfied: pefile>=2017.8.1 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
    Requirement already satisfied: altgraph>=0.15 in ./Library/Python/2.7/lib/python/site-packages (from macholib>=1.8->pyinstaller)
    Requirement already satisfied: future in ./Library/Python/2.7/lib/python/site-packages (from pefile>=2017.8.1->pyinstaller)
    Installing collected packages: pyinstaller
    Successfully installed pyinstaller-3.3.1

The install seems successful, however...

    $ pyinstaller
    -bash: pyinstaller: command not found

I checked my PATH

    $ echo $PATH
    /usr/local/git/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/jc/Library/Python/2.7/lib/python/site-packages

What am I missing here?

Thanks for reading.


回答1:


I had to install the tar.gz file from here:

http://www.pyinstaller.org/downloads.html

Then it can be run from the extracted folder.

    $ python pyinstaller.py script.py



回答2:


On my Mac pip installed the binary in /Users/%Username%/Library/Python/2.7/bin. If you add that to your PATH it should work.



来源:https://stackoverflow.com/questions/49303277/installing-pyinstaller-on-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!