What to do if "export" keeps appearing on terminal when trying to put Python on macOS

Writing history

--I was thinking of using pandas with python --I tried to install pyenv (Reference: [Building a Python environment on a Mac using pyenv]](https://qiita.com/1000ch/items/93841f76ea52551b6a97)) --"$: export" keeps appearing on the terminal ...

$ export

→ "Eh, eh, ??? Did you do something wrong ???"

――I was a little impatient, and (probably) I didn't have an article like "I'm having trouble with the exact same phenomenon!", So I wrote it with the hope that it would be useful to someone.

Prerequisites

--Enter the command prompt display format in " user/"user name" /. Zshrc ". -homebrew is already installed

By the way, the prompt looks like the one below.

#Code in zshrc
PROMPT='[%F{cyan}%# %{No.%h %D %T %$ %C%F{reset_color}]:'
#Display image (color is not reflected)
[% No.58 20-12-28 3:36 User]:python --version

Prompt change reference article: Display / color change of terminal prompt

Causes export continues to be displayed

--The code you wrote was not broken in the ".zshrc" file referenced in the prompt customization **

What does that mean

Description in the ".zshrc" file immediately after passing the path

↓↓↓

PROMPT='[%F{cyan}%# %{No.%h %D %T %$ %C%F{reset_color}]:'export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

Description in the ".zshrc" file after line breaks and improved prompt display

↓↓↓

PROMPT='[%F{cyan}%# %{No.%h %D %T %$ %C%F{reset_color}]:'
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

This is what it is.

The export was listed in the PROMPT line. ..

To summarize the coping procedure

--Show hidden files in Mac Finder ⌘command + shift +. (Dot) --Open the file in " user/"username" /. Zshrc "(make a backup) --Separate the lines of PROMPT code and export code (break a line) --Save the ".zshrc" file --Restart terminal --Done

Anyway, I'm glad it wasn't broken: hushed: ...

Confirmed article (I saw it, but it was different from this case (probably))

-What to do if you destroy the environment variables of Terminal on Mac -[Mac] Solution when major commands cannot be executed in Terminal -[Zsh, bash] How to put in PATH on mac --If you get not found --Shell script export command --Reconfirmed the influence of the export command -How to exit Vim / Vi ――In the above confirmation article, there was a guide to edit with Vim, so I tried it, but I couldn't finish it and checked it (it didn't finish after all).

Reference URL of the person who had the same phenomenon

-teratail: export appears in terminal, I want to erase it ――I think this is probably the number of people who have become the same.

Bonus: pyenv install reference article

-[Building a Python environment on a Mac using pyenv]](https://qiita.com/1000ch/items/93841f76ea52551b6a97) -Progate: Prepare a Python development environment! (Mac) ――It was really polite.

that's all.

Recommended Posts

What to do if "export" keeps appearing on terminal when trying to put Python on macOS
What to do if pip install mysqlclient fails on MacOS
What to do if Python doesn't work on Git for Windows
What to do if Insecure Platform Warning appears when running Python
What to do if PyAudio cannot be installed on Python 3.7, 3.8, 3.9 on Windows
What to do if you get an error when trying to load mnist
What to do if you get a Permission denied (public key) error when trying to pull on Github
What to do if you get an error when installing python with pyenv
What to do if SciPy installation fails on CentOS
What to do when "cannot import name xxx" [Python]
What to do when you can't bind CaboCha to Python
What to do when python3 type venv does not work well on Raspberry Pi
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if the Microsoft Store opens even if you run python on Windows
What to do if you get an error when importing matplotlib in Python (Mac)
What to do if Python IntelliSense is not displayed in VS Code on Windows
What to do if you get the error ʻERR_FEATURE_UNAVAILABLE_ON_PLATFORM` when using ts-node-dev on Linux
What to do if ʻarguments [0] .scrollIntoView ();` fails in python selenium
What to do when Japanese is not displayed on matplotlib
What to do if package installation fails when deploying to heroku
What to do when "SSL: CERTIFICATE_VERIFY_FAILED _ssl.c: 1056" appears in Python
What to do if `pip install matplotlib` fails on Mac
What to do if you can't use WiFi on Linux
What to do if you get an Undefined error:'Module_six_moves_urllib_parse' object has no attribute'urlencode' on MacOS
What to do when no display name occurs when unittesting Python + Tkinter on Github Actions Memo
What to do if you get an Undefined error when trying to use pip with pyenv
What to do if the library doesn't load when you run it in PyCharm, even though it works fine on terminal
What to do if yum breaks
What to do if you can't install pyaudio with pip #Python
What to do if you get a minus zero in Python
What to do if python says "fatal error:'stdio.h' file not found"
How to use python put in pyenv on macOS with PyCall
What to do with PYTHON release?
What to do if the inode is exhausted on EC2 Linux
What to do if you get a must override `get_config` error when trying to model.save in Keras
What to do if you get angry if you don't have libxml / xmlversion.h when installing lxml on CentOS
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
What to do when the value type is ambiguous in Python?
What to do if grep: empty (sub) expression appears on Mac grep
What to do if you get "The session could not be opened" when installing CentOS on VirtualBox
What to do if you get a "Wrong Python Platform" warning when using Python with the NetBeans IDE
[Python] What to do if you get a ModuleNotFoundError when importing pandas using Jupyter Notebook in Anaconda
What to do if a symbolic link error occurs in import cv while trying to install OpenCV in Python
What to do if there is a decimal in python json .dumps
What to do if you couldn't send an email to Yahoo with Python.
What to do if you can't use scikit grid search in Python
What to do if ipython and python start up with different versions
What to do if you forget your login password on Manjaro Linux
What to do if you get stuck during Anaconda installation on Linux
What to do if No Python documentation found for ... appears in pydoc
[Python] What to do when an error related to SSL authentication is returned
What to do if the server doesn't start with python manage.py runserver
What to do if an error occurs when importing numpy with VScode
What to do if fprintd requires a password when registering your fingerprint
Notes on what to do when matplotlib scatter () / scatter3d () does not work
What to do if you get an error when installing Dlib (Ubuntu)
What to do if you get the error RuntimeError: Python is not installed as a framework when trying to use matplitlib and pylab in Python 3.3
What to do if you get an error when trying to send a message in tasks.loop () immediately after startup
What to do if you installed pyenv on Mac OS using Homebrew but the python version doesn't switch
What to do if an error occurs when loading a python project created with poetry into VS Code
Notes on what to do if "macOS 11 or later required!" Appears in Big Sur or pyarrow2.0.0 cannot be installed