PyInstaller on Mac ... does not work easily? - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: PyInstaller on Mac ... does not work easily? (/thread-31036.html) Pages:
1
2
|
PyInstaller on Mac ... does not work easily? - mu234 - Nov-19-2020 Hello All! I am new to this forum, however, I like the forums very much because I learn :) I am having a problem with a pyinstaller, somehow, I get an error: Last login: Thu Nov 19 11:50:46 on ttys001 mkdir: /Users/.../.bash_sessions: Operation not permitted ...SM_Python/build/simple/simple ; exit; MU234s-iMac:~ mu234$ /Users/.../Desktop/Python\ delam/SM_Python/build/simple/simple ; exit; [4606] Error loading Python lib '/Users/.../Desktop/Python delam/SM_Python/build/simple/Python': dlopen: dlopen(/Users/.../Desktop/Python delam/SM_Python/build/simple/Python, 10): image not found logout Saving session... ...copying shared history... ...saving history...truncating history files... ...completed. [Process completed]Any idea why I do not have the permissions? I have ran the pyinstaller as SUDO : sudo pyinstaller simple.py, in addition, there is a problem with finding a python Lib? Not sure what that is? Anyway, I am on MAC and if I run the script in terminal : python ....py works like a charm. Wondering what is going on. Anyway, what can I do to properly have the standalone app? Best. RE: PyInstaller on Mac ... does not work easily? - snippsat - Nov-19-2020 What version of Python are you running,the path look a little strange. Look at The right and wrong way to set Python 3 as default on a Mac So recently pyinstaller is now also updated for Python 3.9. Should not need to run pyinstaller as sudo .Not sure on permissions setup Mac,can make a virtual environment(build into python) that should fix permissions issues. Quick demo. tom@tom-VirtualBox:~$ python -V Python 3.8.5 tom@tom-VirtualBox:~$ pip -V pip 20.2.3 from /home/tom/.pyenv/versions/3.8.5/lib/python3.8/site-packages/pip (python 3.8) # Make tom@tom-VirtualBox:~$ python -m venv py_env # cd in tom@tom-VirtualBox:~$ cd py_env # Activate tom@tom-VirtualBox:~/py_env$ source bin/activate # Install (py_env) tom@tom-VirtualBox:~/py_env$ pip install pyinstaller Collecting pyinstaller Downloading pyinstaller-4.1.tar.gz (3.5 MB) ..... Successfully installed altgraph-0.17 pyinstaller-4.1 pyinstaller-hooks-contrib-2020.10 # Now will pyisntaller run from this folder (py_env) tom@tom-VirtualBox:~/py_env$ which pyinstaller /home/tom/py_env/bin/pyinstaller RE: PyInstaller on Mac ... does not work easily? - mu234 - Nov-20-2020 python 3.9 will have a look at what you are saying ... thanks! (Nov-19-2020, 03:06 PM)snippsat Wrote: What version of Python are you running,the path look a little strange. RE: PyInstaller on Mac ... does not work easily? - mu234 - Nov-20-2020 Interestingly! I have a problem with get a version of pip, have a look at the output when I type $pip -V MU234s-iMac:~ mu234$ python -V Python 3.9.0 MU234s-iMac:~ mu234$ pip -V Traceback (most recent call last): File "/usr/local/bin/pip", line 5, in <module> from pkg_resources import load_entry_point File "/Users/mu234/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 3251, in <module> @_call_aside File "/Users/mu234/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside f(*args, **kwargs) File "/Users/mu234/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/Users/mu234/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 583, in _build_master ws.require(__requires__) File "/Users/mu234/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 900, in require needed = self.resolve(parse_requirements(requirements)) File "/Users/mu234/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 786, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'pip==20.2.4' distribution was not found and is required by the application MU234s-iMac:~ mu234$ I guess I have to reinstall the pip... (Nov-20-2020, 10:21 AM)mu234 Wrote: python 3.9 RE: PyInstaller on Mac ... does not work easily? - mu234 - Nov-20-2020 ok, but when I try to install the pip I get the following :
RE: PyInstaller on Mac ... does not work easily? - mu234 - Nov-20-2020 OK, it seems I have two versions of Python, and the default is Python 2.7 ...
RE: PyInstaller on Mac ... does not work easily? - mu234 - Nov-20-2020 In addition, I do not have the pip :/
RE: PyInstaller on Mac ... does not work easily? - mu234 - Nov-20-2020 OK, solved the problem with PIP with the "python3 get-pip.py" and now I have the pip version
RE: PyInstaller on Mac ... does not work easily? - mu234 - Nov-20-2020 ... and pyinstaller version is 4.0 IS THIS OK now?
RE: PyInstaller on Mac ... does not work easily? - mu234 - Nov-20-2020 OK, now I have followed your instructions and seems ok, but when I run the final .executable in district folder I get the following:
|