`setup.sh` Fails with permission error
Closed this issue · 3 comments
I only became a MacOS user some 20 hours ago, so I don't know what the appropriate way of dealing with this on a Mac is. I also don't really understand why I'm the first one to be hitting this, perhaps it's due to the upgrade to Big Sur which happened yesterday?
Not sure whether the instructions should recommend invoking sudo ./setup.sh
or I should change the owner of /Library/Python/3.8
to my user, or something else entirely? Changing permissions seems like an ugly thing to do, but apparently e.g. homebrew seems to do exactly this to some directories in /usr/local, so perhaps this is customary on MacOS?
Marcins-MBP:workflow marcin$ ./setup.sh
[INFO] Check pip installation, using /usr/bin/python3
[INFO] Installing python packages
Collecting requests==2.25.0 (from -r /Users/marcin/Desktop/workflow/requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/39/fc/f91eac5a39a65f75a7adb58eac7fa78871ea9872283fb9c44e6545998134/requests-2.25.0-py2.py3-none-any.whl (61kB)
|████████████████████████████████| 61kB 1.1MB/s
Collecting certifi>=2017.4.17 (from requests==2.25.0->-r /Users/marcin/Desktop/workflow/requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/5e/a0/5f06e1e1d463903cf0c0eebeb751791119ed7a4b3737fdc9a77f1cdfb51f/certifi-2020.12.5-py2.py3-none-any.whl (147kB)
|████████████████████████████████| 153kB 4.3MB/s
Collecting urllib3<1.27,>=1.21.1 (from requests==2.25.0->-r /Users/marcin/Desktop/workflow/requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/23/fc/8a49991f7905261f9ca9df5aa9b58363c3c821ce3e7f671895442b7100f2/urllib3-1.26.3-py2.py3-none-any.whl (137kB)
|████████████████████████████████| 143kB 4.6MB/s
Collecting chardet<4,>=3.0.2 (from requests==2.25.0->-r /Users/marcin/Desktop/workflow/requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
|████████████████████████████████| 143kB 4.8MB/s
Collecting idna<3,>=2.5 (from requests==2.25.0->-r /Users/marcin/Desktop/workflow/requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl (58kB)
|████████████████████████████████| 61kB 5.1MB/s
Installing collected packages: certifi, urllib3, chardet, idna, requests
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/3.8'
Consider using the `--user` option or check the permissions.
I'm on Linux but I recall I had some trouble while trying to use system Python. I solved this by installing Python with pyenv
. This python is installed in user directory and so there are no permission issues.
See
- https://github.com/pyenv/pyenv#installation
- https://github.com/pyenv/pyenv/wiki#suggested-build-environment
- https://github.com/pyenv/pyenv-installer#install
- Then run something like
pyenv install 3.9.1
pyenv global 3.9.1
python --version
Right, I suspect there are many ways to skin a cat (my knee-jerk reaction was to use pipenv
) but the mere existence of this repo suggests there should be a common way for the whole team to operate.
If we settle on a solution, then it should be documented in the README and/or onboarding docs.
Otherwise everyone comes up with their own workaround which differs in subtle ways, resulting in a world of pain.
I've ran into the same issue. The script is trying to install packages system-wide, which brings quite a lot of problems for OS-managed Python installations.
The script can either be run with sudo to install the packages system-wide or setup.sh can be updated here (
Line 14 in 183985d
The latter might be the better way to go