Mac下配置python开发基础环境(brew)

本文介绍了如何在Mac上通过home-brew来安装和配置Python开发环境,包括安装home-brew,设置国内镜像源,安装python3,pip3,virtualenv,git,mysql和redis,并提供了Pycharm的下载链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装home-brew https://brew.sh/index_zh-cn 

https://blog.youkuaiyun.com/fxp850899969/article/details/53284193

 

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

 

替换home-brew

# 替换brew.git:

$ cd "$(brew --repo)"

# 中国科大:

$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

# 清华大学:

$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

 

# 替换homebrew-core.git:

$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

# 中国科大:

$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

# 清华大学:

$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

 

# 替换homebrew-bottles:

# 中国科大:

$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile

$ source ~/.bash_profile

# 清华大学:

$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile

$ source ~/.bash_profile

 

# 应用生效:

$ brew update

 

安装python3     https://www.cnblogs.com/meng1314-shuai/p/9031686.html

brew search python3 搜索

brew install python3

 

安装pip3 

curl https://bootstrap.pypa.io/get-pip.py | python3 

pip --version

 

安装virtualenv

sudo pip install virtualenv

sudo pip install virtualenvwrapper

 

vi ~/.bash_profile

 

将一下内容放入文件最后

export WORKON_HOME=$HOME/.virtualenvs

source /usr/local/bin/virtualenvwrapper.sh

 

运行

source ~/.bash_profile

 

Git

brew install git

 

永久记住密码

git config --global user.name "wenbo"

git config --global user.email "1050794513@qq.com"

 

Mysql

brew install mysql

 

Redis

brew install redis

 

下载macPycharm

前往下载地址:https://www.jetbrains.com/pycharm/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值