Alas, no, that’s worse:
$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
I tried a few times to uninstall (via both brew uninstall and by just trying to remove directories) and reinstall (via homebrew) python but no luck. In case you’re interested:
$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
$ brew uninstall python
Error: Refusing to uninstall /usr/local/Cellar/python/2.7.14
because it is required by ipython@5 5.5.0_1, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies python
$ brew uninstall ipython
Error: No such keg: /usr/local/Cellar/ipython
$ pip uninstall ipython
Cannot uninstall requirement ipython, not installed
$ brew uninstall python2
Error: Refusing to uninstall /usr/local/Cellar/python/2.7.14
because it is required by ipython@5 5.5.0_1, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies python2
$ brew uninstall --ignore-dependencies python2
Uninstalling /usr/local/Cellar/python/2.7.14... (3,555 files, 49MB)
$ brew install python
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
baresip ffmpeg mpv rpm
bento4 folly nsq simgrid
cargo-completion fzf passenger xmrig
citus hugo pony-stable
cookiecutter jenkins primesieve
derby libextractor qcli
==> Downloading https://homebrew.bintray.com/bottles/python-2.7.14.high_sierra.b
Already downloaded: /Users/michael/Library/Caches/Homebrew/python-2.7.14.high_sierra.bottle.tar.gz
==> Pouring python-2.7.14.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> Caveats
This formula installs a python2 executable to /usr/local/bin.
If you wish to have this formula's python executable in your PATH then add
the following to ~/.bash_profile:
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
Pip and setuptools have been installed. To update them
pip2 install --upgrade pip setuptools
You can install Python packages with
pip2 install <package>
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: https://docs.brew.sh/Homebrew-and-Python.html
==> Summary
🍺 /usr/local/Cellar/python/2.7.14: 3,517 files, 48.4MB
$ pip2 install --upgrade pip setuptools
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages
Collecting setuptools
Downloading setuptools-36.6.0-py2.py3-none-any.whl (481kB)
100% |████████████████████████████████| 481kB 2.0MB/s
Installing collected packages: setuptools
Found existing installation: setuptools 36.5.0
Uninstalling setuptools-36.5.0:
Successfully uninstalled setuptools-36.5.0
Successfully installed setuptools-36.6.0
$ mm .bash_profile
[1] 59358
$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
Fatal Python error: PyThreadState_Get: no current thread
[1]+ Done emacs $var
Abort trap: 6
$ which python
/usr/bin/python
$ which python2
/usr/local/bin/python2
$ which python3
/usr/local/bin/python3
$ rm -r /usr/bin/python
python python2.7 pythonw
python-config python2.7-config pythonw2.7
$ rm -r /usr/bin/python*
override rwxr-xr-x root/wheel restricted,compressed for /usr/bin/python? n
override rwxr-xr-x root/wheel restricted,compressed for /usr/bin/python-config? n
rm: /usr/bin/python2.7: Operation not permitted
rm: /usr/bin/python2.7-config: Operation not permitted
override rwxr-xr-x root/wheel restricted,compressed for /usr/bin/pythonw? rm -r /usr/bin/python
rm: /usr/bin/pythonw2.7: Operation not permitted
$ rm -r /usr/bin/python*
override rwxr-xr-x root/wheel restricted,compressed for /usr/bin/python? yes
rm: /usr/bin/python: Operation not permitted
override rwxr-xr-x root/wheel restricted,compressed for /usr/bin/python-config? no
rm: /usr/bin/python2.7: Operation not permitted
rm: /usr/bin/python2.7-config: Operation not permitted
override rwxr-xr-x root/wheel restricted,compressed for /usr/bin/pythonw? no
rm: /usr/bin/pythonw2.7: Operation not permitted
$
$
$
$ rm -r /usr/local/bin/py
pydoc2 python2 python3-config pythonw2
pydoc2.7 python2-config python3.6 pythonw2.7
pydoc3 python2.7 python3.6-config pyvenv
pydoc3.6 python2.7-config python3.6m pyvenv-3.6
pygmentize python3 python3.6m-config
$ rm -r /usr/local/bin/python2
$ rm -r /usr/local/bin/python3
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/Applications/root_build/bin/root-config
$ brew prune
$ brew install python
Warning: python 2.7.14 is already installed
$ python2
-bash: /usr/local/bin/python2: No such file or directory
$ python
Python 2.7.10 (default, Jul 15 2017, 17:16:57)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
>>> f = TFile.Open("root://eoslhcb.cern.ch//eos/lhcb/user/m/mwilkins/bfractions_fromGanga/data/Down16/548.100/DVnTuples.root")
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdUtils.2.dylib
Referenced from: /Applications/root_build/lib/libNetxNG.so
Reason: unsafe use of relative rpath libXrdUtils.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libNetxNG.so for TNetXNGSystem
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdUtils.2.dylib
Referenced from: /Applications/root_build/lib/libNetxNG.so
Reason: unsafe use of relative rpath libXrdUtils.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdUtils.2.dylib
Referenced from: /Applications/root_build/lib/libNetxNG.so
Reason: unsafe use of relative rpath libXrdUtils.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libNetxNG.so for TNetXNGFile
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdUtils.2.dylib
Referenced from: /Applications/root_build/lib/libNetxNG.so
Reason: unsafe use of relative rpath libXrdUtils.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
>>> ^D
$ brew uninstall python
Error: Refusing to uninstall /usr/local/Cellar/python/2.7.14
because it is required by ipython@5 5.5.0_1, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies python
$ brew uninstall --ignore-dependenies python
Error: Refusing to uninstall /usr/local/Cellar/python/2.7.14
because it is required by ipython@5 5.5.0_1, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies python
$ brew uninstall --ignore-dependencies python
Uninstalling /usr/local/Cellar/python/2.7.14... (3,564 files, 49.2MB)
$ brew uninstall --ignore-dependencies python
Error: No such keg: /usr/local/Cellar/python
$ which python
/usr/bin/python
$ rm -r /usr/bin/python
override rwxr-xr-x root/wheel restricted,compressed for /usr/bin/python? yes
rm: /usr/bin/python: Operation not permitted
$ rm -r /usr/bin/python
override rwxr-xr-x root/wheel restricted,compressed for /usr/bin/python? y
rm: /usr/bin/python: Operation not permitted
$ which python
/usr/bin/python
$ brew install python2
==> Downloading https://homebrew.bintray.com/bottles/python-2.7.14.high_sierra.b
Already downloaded: /Users/michael/Library/Caches/Homebrew/python-2.7.14.high_sierra.bottle.tar.gz
==> Pouring python-2.7.14.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> Caveats
This formula installs a python2 executable to /usr/local/bin.
If you wish to have this formula's python executable in your PATH then add
the following to ~/.bash_profile:
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
Pip and setuptools have been installed. To update them
pip2 install --upgrade pip setuptools
You can install Python packages with
pip2 install <package>
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: https://docs.brew.sh/Homebrew-and-Python.html
==> Summary
🍺 /usr/local/Cellar/python/2.7.14: 3,517 files, 48.4MB
$ pip2 install --upgrade pip setuptools
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages
Collecting setuptools
Using cached setuptools-36.6.0-py2.py3-none-any.whl
Installing collected packages: setuptools
Found existing installation: setuptools 36.5.0
Uninstalling setuptools-36.5.0:
Successfully uninstalled setuptools-36.5.0
Successfully installed setuptools-36.6.0
$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
$