0

我是新与IPython的,我有这个尴尬的问题,使用笔记本:当我尝试使用matplotlibPython路径对于IPython笔记本来说很重要吗?

%matplotlib inline 

我得到这个错误

ImportError: /home/ipython/anaconda2/bin/../lib/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3)

不过。如果我在之前执行以下的代码:

import sys 
sys.path.reverse() 

它的工作原理!

现在的问题是:python路径的顺序是否重要?我是否需要按照正确的顺序安装python依赖项,或将python路径设置为正确的顺序?

谢谢!

PS:我使用jupyter服务器4.

回答

0

我敢肯定,路径做的事,但以同样的方式像任何其他的Python程序。

When a module named spam is imported, the interpreter first searches for a built-in module with that name. If not found, it then searches for a file named spam.py in a list of directories given by the variable sys.path.

https://docs.python.org/2/tutorial/modules.html#the-module-search-path

无论如何,我认为你应该先尝试这种workaround,即添加到您的.bashrc

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgfortran.so.3

如果它不能帮助你可以尝试改变PYTHONPATH在.bashrc中。蟒蛇在那里增加。所以你可以交换它。

不要忘了source ~/.bashrc

+0

感谢您的帮助和尖端更换后重新加载.bashrc! 它使用这个LD_PRELOAD。 –