美文网首页
2018 Mac 下python3环境配置

2018 Mac 下python3环境配置

作者: 小米bb | 来源:发表于2018-08-07 11:02 被阅读0次
    brew search python3
    

    安装Python3,等待......

    brew install python3
    

    环境变量配置

     vi ~/.bash_profile
    
    PATH=$PATH:/usr/local/mysql/bin:/usr/local/Cellar/python3/3.7.0/bin
    M2_HOME=/Users/huipay/Documents/apache-maven-3.5.3
    PATH=$PATH:$M2_HOME/bin
    export M2_HOME
    export PATH
    export LC_ALL=en_US.UTF-8
    export LANG=en_US.UTF-8
    ~                                                                                                                                                                             
    

    注意点:确保优先搜索用户路径

    sudo vim /etc/paths
    
    /usr/local/bin
    /usr/bin
    /bin
    /usr/sbin
    /sbin
    
    
    brew link python3
    
    brew install python3
    Warning: python3 3.6.3 is already installed, it's just not linked.
    You can use `brew link python3` to link this version.
    $ brew link python3
    Linking /usr/local/Cellar/python3/3.6.3... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
    

    发现/usr/local/下没有路径/usr/local/Frameworks
    需要新建该路径,并修改权限

    $ sudo mkdir /usr/local/Frameworks
    $ sudo chown $(whoami):admin /usr/local/Frameworks
    

    找不到pip3?

    brew reinstall python3 --with-brewed-openssl
    

    愉快的玩耍吧~~

    相关文章

      网友评论

          本文标题:2018 Mac 下python3环境配置

          本文链接:https://www.haomeiwen.com/subject/xijovftx.html