Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find python and python3 config directories for Homebrew installation?

I installed python and python3 using Homebrew on Mac OS X (Yosemite 10.10.5). But I don't know where the relevant config directories are. How can I find them?

like image 627
soarinblue Avatar asked Jul 19 '16 07:07

soarinblue


2 Answers

Try using the ls option of brew:

brew ls python
like image 189
Mark Setchell Avatar answered Sep 18 '22 13:09

Mark Setchell


Asking the provider always goes a long way:

$ brew info python3

On my machine - an El Capitan - it currently states:

python3: stable 3.5.2 (bottled), devel 3.6.0a3, HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python3/3.5.1 (3,659 files, 53.2M)
  Poured from bottle on 2015-12-08 at 06:59:56
/usr/local/Cellar/python3/3.5.2 (7,717 files, 109.3M) *
  Built from source on 2016-07-11 at 10:37:37
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/python3.rb

# - - 8 < - -
They will install into the site-package directory
  /usr/local/lib/python3.5/site-packages

As @MarkSetchell suggest you can also use ls which in my system shows:

$ brew ls python3
/usr/local/Cellar/python3/3.5.2/bin/2to3-3.5
/usr/local/Cellar/python3/3.5.2/bin/easy_install-3.5
/usr/local/Cellar/python3/3.5.2/bin/idle3
/usr/local/Cellar/python3/3.5.2/bin/idle3.5
/usr/local/Cellar/python3/3.5.2/bin/pip3
/usr/local/Cellar/python3/3.5.2/bin/pip3.5
/usr/local/Cellar/python3/3.5.2/bin/pydoc3
/usr/local/Cellar/python3/3.5.2/bin/pydoc3.5
/usr/local/Cellar/python3/3.5.2/bin/python3
/usr/local/Cellar/python3/3.5.2/bin/python3-config
/usr/local/Cellar/python3/3.5.2/bin/python3.5
/usr/local/Cellar/python3/3.5.2/bin/python3.5-config
/usr/local/Cellar/python3/3.5.2/bin/python3.5m
/usr/local/Cellar/python3/3.5.2/bin/python3.5m-config
/usr/local/Cellar/python3/3.5.2/bin/pyvenv
/usr/local/Cellar/python3/3.5.2/bin/pyvenv-3.5
/usr/local/Cellar/python3/3.5.2/bin/wheel3
/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/ (6811 files)
/usr/local/Cellar/python3/3.5.2/IDLE 3.app/Contents/ (8 files)
/usr/local/Cellar/python3/3.5.2/lib/pkgconfig/ (3 files)
/usr/local/Cellar/python3/3.5.2/libexec/pip/ (522 files)
/usr/local/Cellar/python3/3.5.2/libexec/setuptools/ (242 files)
/usr/local/Cellar/python3/3.5.2/libexec/wheel/ (93 files)
/usr/local/Cellar/python3/3.5.2/Python Launcher 3.app/Contents/ (16 files)
/usr/local/Cellar/python3/3.5.2/share/man/ (2 files)

What is confined below /usr/local/lib and the specific version "cellar" (here /usr/local/Cellar/python3/3.5.2/ in my experience deserves some care and attention ;-)

Sometimes I forget, and then I do as if I wanted to upgrade a package I installed just to have the matching pip print out the path I forgot:

$ pip3 install --upgrade requests
Requirement already up-to-date: requests in /usr/local/lib/python3.5/site-packages
like image 35
Dilettant Avatar answered Sep 19 '22 13:09

Dilettant