今日のpythonエラー(macOS)


$ brew install anaconda

Error: No available formula with the name "anaconda" 
Found a cask named "anaconda" instead. Try
  brew cask install anaconda

$ brew cask install anaconda
==> Caveats
Cask anaconda installs files under /usr/local. The presence of such
files can cause warnings when running `brew doctor`, which is considered
to be a bug in Homebrew Cask.

==> Satisfying dependencies
==> Downloading https://repo.anaconda.com/archive/Anaconda3-2019.07-MacOSX-x86_64.sh
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'anaconda'.
==> Installing Cask anaconda
==> Running installer script 'Anaconda3-2019.07-MacOSX-x86_64.sh'
Password:
PREFIX=/usr/local/anaconda3
Unpacking payload ...
Collecting package metadata (current_repodata.json): ...working... done                                             
Solving environment: ...working... done

...

$ python
Python 2.7.10 (default, Feb  7 2017, 00:08:15) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
$ python3
bash: python3: command not found
$ pyenv
pyenv 1.2.13


$ curl -kL https://bootstrap.pypa.io/get-pip.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1734k  100 1734k    0     0   787k      0  0:00:02  0:00:02 --:--:--  787k
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pip
  Downloading https://files.pythonhosted.org/packages/4a/08/6ca123073af4ebc4c5488a5bc8a010ac57aa39ce4d3c8a931ad504de4185/pip-19.3-py2.py3-none-any.whl (1.4MB)
     |████████████████████████████████| 1.4MB 1.3MB/s 
Collecting wheel
  Downloading https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
Installing collected packages: pip, wheel
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Consider using the `--user` option or check the permissions.

$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Failed to create the file get-pip.py: Permission denied
  0 1734k    0  2227    0     0   8574      0  0:03:27 --:--:--  0:03:27  8598
curl: (23) Failed writing body (0 != 2227)


$ pip install matplotlib
bash: pip: command not found
bash-3.2$ curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100    15  100    15    0     0     23      0 --:--:-- --:--:-- --:--:--   250
  File "<stdin>", line 1
    404: Not Found
       ^
SyntaxError: invalid syntax