macOS 安装 python
来源:互联网 发布:centos 6 搜狗输入法 编辑:程序博客网 时间:2024/05/16 14:12
环境: macOS Sierra 10.12.1不要用mac系统自带的python, 用brew重新装一个,然后把/usr/local/bin/python指向brew目录下的python.摘自: http://stackoverflow.com/questions/17271319/how-to-install-pip-on-mac-os-xInstalling a separate copy of Python is a popular option, even though Python already comes with MacOS. You take on the responsibility to make sure you're using the copy of Python you intend. But, the benefits are having the latest Python release and some protection from hosing your system if things go badly wrong.To install Python using HomeBrew:```shbrew updatebrew install python # or brew install python3```Now confirm that we're working with our newly installed Python:```shls -lh `which python````...should show a symbolic link to a path with "Cellar" in it like:```shlrwxr-xr-x 1 chris admin 35B Dec 2 13:40 /usr/local/bin/python -> ../Cellar/python/2.7.8_2/bin/python```**cyper notes: **我没有指到这个目录, 我用`brew switch python x`命令切了一下, 就正常了, 结果如下:```sh? ~ brew switch python xError: python does not have a version "x" in the Cellar.Versions available: 2.7.12_2? ~ brew switch python 2.7.12_2Cleaning /usr/local/Cellar/python/2.7.12_239 links created for /usr/local/Cellar/python/2.7.12_2? ~ ls -lh `which python`lrwxr-xr-x 1 cyper admin 36B Dec 5 16:31 /usr/local/bin/python -> ../Cellar/python/2.7.12_2/bin/python? ~```Pip should be installed along with Python. You might want to upgrade it by typing:```pip install --upgrade pip```Now you're ready to install any of the 50,000+ packages on PyPI.### Other NotesFormerly, I've used get-pip.py to install pip. But, the docs warn that get-pip.py does not coordinate with package managers and may leave your system in an inconsistent state. Anyway, there's no need, given that pip is now included with Python as of 2.7.9.Note that pip isn't the only package manager for Python. There's also easy_install. It's no good to mix the two, so don't do it.Finally, if you have both Python 2 and 3 installed, pip will point to whichever Python you installed last. Get in the habit of explicitly using either pip2 or pip3, so you're sure which Python is getting the new library.Happy hacking!
0 0
- macOS 安装 python
- MacOS安装Python环境
- macos下 python安装cx_oracle
- MacOS Lion 安装MySQLdb for python
- Python安装第三方库(macOS)
- macOS系统 安装MySQL-python驱动方法
- macOS: 安装OpenCV 3.2.0 和Python 3.6.0
- MacOS搭建Python环境
- MacOS X 安装 Mysql
- 虚拟机安装macOS
- 虚拟机安装MacOS步骤
- VMware安装MacOS系统
- macos安装thrift
- MacOS安装记
- MacOS安装mod_python
- MacOS 下安装Gerrit
- 虚拟机安装MacOS
- VMware12pro 安装MacOS 10.11
- 创建web项目不能生成web.xml文件
- 创建filter,及web.xml文件配置
- Java练习:Overriding Vs. Overloading经典笔试题
- Chapter 3. GRUB
- First Bad Version
- macOS 安装 python
- spring boot下JedisCluster客户端的配置,连接Redis集群
- 什么是敲诈者病毒
- 关于Java的path,classpath,java_home环境变量的配置与具体含义
- Syncthing免费开源的文件同步工具-带版本控制可用于构建个人云存储
- Java注释和注释模板
- 善用Eclipse的代码模板功能
- Apache与Tomcat有什么关系和区别
- Charpter 5. Linux Filesystem Tree Layout