What to do if ipython and python start up with different versions

Check python and ipython versions

When you start python or ipython in an interactive shell, the version should first be written as below

If the version is different between ipython and pyhton, the installed package will be different and it will be troublesome ... so the story when I fixed it スクリーンショット 2017-05-10 16.15.07.png

approach

$ which python $ which ipython Check each location with

which ipythonThe place that came out in (/usr/local/bin/About ipython etc.) $ vi /usr/local/bin/ipythonEdit with etc.

Then

#!/Users/user_name/.pyenv/shims/python

set -e
[ -n "$PYENV_DEBUG" ] && set -x

program="${0##*/}"
if [[ "$program" = "python"* ]]; then
  for arg; do
    case "$arg" in
    -c* | -- ) break ;;
    */* )
      if [ -f "$arg" ]; then
        export PYENV_FILE_ARG="$arg"
        break
      fi
      ;;
    esac
  done
fi

It should look like this, so let's change the top line to the location where it came out with `` `which python```

Now when I restart the terminal, ipython starts with the same version as python!

Reference: http://stackoverflow.com/questions/9386048/ipython-reads-wrong-python-version

Recommended Posts

What to do if ipython and python start up with different versions
What to do if the server doesn't start with python manage.py runserver
What to do with PYTHON release?
How to install and use pyenv, what to do if you can't switch python versions
What to do if you run python in IntelliJ and end with an error
What to do if you can't install pyaudio with pip #Python
What to do if you couldn't send an email to Yahoo with Python.
What to do if you get an error when installing python with pyenv
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if ʻarguments [0] .scrollIntoView ();` fails in python selenium
What to do if you can't sort files with subscripts
Try to bring up a subwindow with PyQt5 and Python
How to do Bulk Update with PyMySQL and notes [Python]
What to do if yum breaks
What to do with Magics install
To do tail recursion with Python2
What to do if you get Swagger-codegen in python and Import Error: No module named
Python | What you can do with Python
Don't write Python if you want to speed it up with Python
What to do if Python doesn't work on Git for Windows
What to do if you get a minus zero in Python
What to do if intellisense doesn't work with Anaconda + VSCode + Tensorflow2.1
What to do if python says "fatal error:'stdio.h' file not found"
What to do if you get a UnicodeDecodeError with pip install
What to do if Insecure Platform Warning appears when running Python
What to do if you can't build your project with Maven
What to do if PyAudio cannot be installed on Python 3.7, 3.8, 3.9 on Windows
NameError: global name'dot_parser' is not defined and what to do when it comes up in python
Fractal to make and play with Python
How to do portmanteau test with python
What skills do I need to program with the FBX SDK Python?
What to do if you can't find well with grep's -f option
What to do if there is a decimal in python json .dumps
What to do if you can't use scikit grid search in Python
[Introduction to Python] How to judge authenticity with if statement (True and None)
What to do if you get lost in file reference with FileNotFoundError
What to do if the Chainer (Windows) sample mnist terminates with WinError 183.
What to do if pyenv install does not proceed with an error
What to do if No Python documentation found for ... appears in pydoc
What to do if an error occurs when importing numpy with VScode
What to do if you get a TypeError with numpy min, max
What to do if you can't install with pip in babun environment
What to do if you get Could not fetch URL 443 with pip
What to do if you get a "Wrong Python Platform" warning when using Python with the NetBeans IDE
What to do if you get angry with "Value Error: unknown local: UTF-8" in python manage.py syncdb
[Python] What to do if an error occurs in pip (pyinstaller, pyautogui, etc.)
What to do if you get a "No versions found" error in pipenv
Scraping tabelog with python and outputting to CSV
MessagePack-Try to link Java and Python with RPC
What to do if you get angry with swapon failed: Operation not permitted
How to do multi-core parallel processing with python
What to do if pipreqs results in UnicodeDecodeError
[Python] What I did to do Unit Test
What to do if the latest Jupyter Notebook and nb extensions don't work
Note: What to do if pip install fails
What to do if mod_fcgid cannot resolve UnicodeEncodeError
What to do if rails s doesn't work
[Note] What to do if the Qt library conflicts between pyqt and opencv
I tried speeding up Python code including if statements with Numba and Cython
What to do if scrapy doesn't work after installing scrapy with pip on mac
Developed and verified with multiple python versions with direnv