ipython install new modules

后端 未结 4 758
一个人的身影
一个人的身影 2021-02-01 08:25

I am used to the R functionality of installing packages and I am trying to do the same thing with ipython. Sometimes the following method works but then again somet

4条回答
  •  野的像风
    2021-02-01 09:07

    If the new packages installed are imported on Terminal but not imported to ipython notebook then it is very likely that you have two versions of python installed on your library. Due to this there are separate site-packages directory from where packages are being imported on terminal and ipython notebook. To check if this is the case. On terminal use:

    import sys
    sys.path
    

    This will show where the python modules are located for python you using on terminal. Now, in ipython notebook use:

    import sys
    sys.path
    

    This will show where the python modules are located for python you using on terminal.

    Now, if the two path are different you know you are using two different installations of python. To solve this problem, copy installed packages from site-packages directory of terminal python to site-packages directory of ipython.

提交回复
热议问题