Skip to content

Instantly share code, notes, and snippets.

@jozcar
Last active February 26, 2019 01:48
Show Gist options
  • Save jozcar/6af82efc0553b04a896258b4ceaccd61 to your computer and use it in GitHub Desktop.
Save jozcar/6af82efc0553b04a896258b4ceaccd61 to your computer and use it in GitHub Desktop.
Using Python 3 on a mac
1. use brew to install it :
> brew install python
2. this installs python3 however it did not link it got the following error:
Linking /usr/local/Cellar/python/3.7.2_2... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
the user here was that there was no Frameworks directory under /usr/local, I use the following to fix this:
> cd /usr/local
> sudo makedir Frameworks
> sudo chown $(whoami):admin /usr/local/Frameworks
> brew link python
3.getting pip install ( for me this was not install, the following work,i also needed to set path to call pip)
> curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
> python get-pip.py
> sudo nano /etc/paths
the above command opens the path file, i enter the following:
usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/bin
- Hit control-x to quit.
- Enter “Y” to save the modified buffer.
`Experience issues installing pipenv, by doing this was I got this to work`
> sudo -H pip install -U pipenv
- this will install pipenv, this will allow you to create a env, to test, create a directory and cd into
> pinenv install [name of package]
- to test, just create a py file, to run this file do the following
> pipenv run python3 [name of file].py
Use this for more advance examples
https://docs.python-guide.org/dev/virtualenvs/#virtualenvironments-ref
this fix the issue for me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment