I managed to solve the situation where Python does not work on Mac

Hello.

To learn AWS I wanted to put awscli on my Mac, so I used Python. A situation occurred in which an error occurred and it did not work.

python


-bash: /usr/local/bin/python: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

I was playing around with it in the survey, so maybe I was playing with something strange. In the first place, there is no such file as /usr/local/opt/python/bin/python2.7.

I've tried many things, but I haven't touched UNIX at all. Uninstall python once and reinstall it. However, the situation has not changed.

If you check the installation log, you will notice that there is an error.

python


Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'

To force the link and overwrite all conflicting files:
  brew link --overwrite python

To list all files that would be deleted:
  brew link --overwrite --dry-run python

It seems that the symbolic already existed and could not be updated.

python


  brew link --overwrite python

I ran the above command and it worked!

python


$ python 
Python 2.7.10 (default, Sep 23 2015, 04:34:14) 

I still have a lot of lack of study, so I will study little by little. For the time being, I think I can start studying AWS.

Recommended Posts

I managed to solve the situation where Python does not work on Mac
[Pyhton] I want to solve the problem that tkinter does not work on MacOS11
Virtualenv does not work on Python3.5 (Windows)
When the program pip installed on Mac / Marvericks does not work
Jinja2 2.9.6 does not work on Lambda Python 3 series
I tried Python on Mac for the first time.
Steps to install the latest Python on your Mac
I tried to solve the soma cube with python
I want to AWS Lambda with Python on Mac!
I tried to solve the problem with Python Vol.1
What to do when python3 type venv does not work well on Raspberry Pi
Update python on Mac to 3.7-> 3.8
I wanted to solve the Panasonic Programming Contest 2020 with Python
I tried changing the python script from 2.7.11 to 3.6.0 on windows10
Parallel processing of Python joblib does not work in uWSGI environment. How to process in parallel on uWSGI?
LocateCenterOnScreen does not work on PyAutoGui
Steps to install python3 on mac
Update Python on Mac from 2 to 3
I tried to solve the ant book beginner's edition with python
I want to know if you install Python on Mac ・ Iroha
I wanted to solve the ABC164 A ~ D problem with Python
I tried to improve the efficiency of daily work with Python
Arrow keys do not work in zsh + python shell on mac
How to solve the problem that APL does not start after transferring to the actual device on Kivy-iOS
[Python] I tried to visualize the night on the Galactic Railroad with WordCloud!
[VScode] autopep8 format does not work [Python]
I wanted to solve ABC160 with Python
Work memo to migrate and update Python 2 series scripts on the cloud to 3 series
I want to use Linux on mac
How to erase Python 2.x on Mac.
Check items when the imported python module does not work as expected
I wanted to solve ABC159 in Python
Python> Python does not include the last offset
I tried with the top 100 PyPI packages> I tried to graph the packages installed on Python
Notes on what to do when matplotlib scatter () / scatter3d () does not work
I wanted to solve ABC172 with Python
Example of what to do when the sample script does not work (OpenCV-Python)
I want to use Python in the environment of pyenv + pipenv on Windows 10
I stumbled on the character code when converting CSV to JSON in Python
I tried to use Resultoon on Mac + AVT-C875, but I was frustrated on the way.
[IBM Cloud] I tried to access the Db2 on Cloud table from Cloud Funtions (python)
When I try to use Jupiter notebook on Mac, I can only select python2
Try to solve the Python class inheritance problem
I wanted to solve NOMURA Contest 2020 with Python
Try to solve the man-machine chart with Python
After installing php7.2, the php command does not work
Excel X Python The fastest way to work
Introduction to Python with Atom (on the way)
I want to solve APG4b with Python (Chapter 2)
[Python] I will upload the FTP to the FTP server.
I want to display the progress in Python!
jupyter notebook does not start on mac fish
python on mac
I tried to find out how to streamline the work flow with Excel x Python ②
I tried to find out how to streamline the work flow with Excel x Python ④
[systemd] How to deal with the problem that fancontrol does not work after suspending
I tried to find out how to streamline the work flow with Excel x Python ⑤
I tried to find out how to streamline the work flow with Excel x Python ①
Steps to use the AWS command line interface (Python / awscli) on Mac OS X
What to do if Python does not switch from the System version in pyenv
I tried to find out how to streamline the work flow with Excel x Python ③