After changing the account name on Mac, pip and ipython became unusable, so I reinstalled the whole python and it was cured

Overview

After changing the account name of mac, pip and ipython installed by pyenv can no longer be used, so I can use it after reinstalling python.

environment

macOS Catalina 10.15.4 Homebrew 2.2.11 pyenv 1.2.17 python 3.8.0

Background

I used brew to install pyenv on my mac, and then installed and used python on that pyenv. After that, I changed the mac account name (and home directory name) for various reasons. To change the account name, follow the Official Description. The change itself worked fine, but when I ran pip or ipython I got the following error and it became unusable.

>> ipython
/usr/local/Cellar/pyenv/1.2.17/pyenv.d/exec/pip-rehash/pip: /Users/[new home directory name]/.pyenv/versions/3.8.0/bin/pip: /Users/[old home directory name]/.pyenv/versions/3.8.0/bin/python3.8: bad interpreter: No such file or directory

It seems that I'm angry when I go looking for python with the old home directory name and can't find it. I think there are some old settings left, but I often wonder where "/Users/[old home directory name] /.pyenv/versions/3.8.0/bin/python3.8" is defined. I didn't know, so I gave up and reinstalled python 3.8.0 with pyenv and it was cured.

pyenv uninstall 3.8.0
pyenv install 3.8.0

Recommended Posts

After changing the account name on Mac, pip and ipython became unusable, so I reinstalled the whole python and it was cured
[Python] I installed the game from pip and played it
The file name was bad in Python and I was addicted to import
The file name saved by pysheng was a hexadecimal number, so I fixed it.
I got an error when pip install pandas on Mac, so I dealt with it
I tried Python on Mac for the first time.
I installed the retro game engine pyxel for Python on Mac and started the sample code