Why python's versions differ when called from Terminal and from Atom

后端 未结 3 843
醉梦人生
醉梦人生 2021-01-27 10:13

When I run Python from the terminal and from Atom, different versions of python are called. As a consequence, there are packages that I can call without problems fr

3条回答
  •  感情败类
    2021-01-27 10:40

    Ok, I had actually to change the Path in the .json file of the jupyter kernel. First I checked the list of jupyter kernel:

    $ jupyter kernelspec list
    julia-0.6    /Users/mymac/Library/Jupyter/kernels/julia-0.6
    julia-1.0    /Users/mymac/Library/Jupyter/kernels/julia-1.0
    python3      /Users/mymac/Library/Jupyter/kernels/python3
    

    I then cd the above python path and, I found the file kernel.json inside and opened it:

    {
     "argv": [
      "/path/to/python",
      "-m",
      "ipykernel_launcher",
      "-f",
      "{connection_file}"
     ],
     "display_name": "Python 3",
     "language": "python"
    }
    

    In that file, I then changed the line /path/to/python by the python path I got when typing the following in Terminal:

    $ which python
    /Users/mymac/anaconda3/bin/python
    

    Relaunched Atom and it finally worked!

    The hints of the github page of jupyter helped also a lot!

提交回复
热议问题