【发布时间】:2017-05-22 16:57:33
【问题描述】:
我在 Ubuntu 中使用 python 2.7,最近更新了 tensorflow 0.12.1。 我今天为我的 tf 示例代码安装了 jupyter,我需要使用 matplotlib。在tensorflow中找不到模块名matplotlib和ipython有同样的错误。
1。如何在 virtualenv 或 ipython 或 jupyter 中设置路径?
激活tensorflow后,我需要使用jupyter notebook。
这在脚本下面的错误不起作用。
import sys
sys.path.append('my/path/to/module/folder')
import module-of-interest
2。其他信息:我的环境如下。
mickyefromsd@DEKSTOP~$source ~/tensorflow/bin/activate
当我在TF条件下和TF激活之前通过python脚本找到matplotlib时,它有以下内容;
/usr/lib/python2.7/dist-packages/matplotlib/
当我输入“which ipython”时,它在下面(不是 /usr/bin/ipython);
/home/mickeyfromd/tensorflow/bin/ipython
顺便说一句,/tensorflow/lib/python2.7/site-packages/ 它有 ipython 和 jupyter。
(不在matplotlib同一路径)
3。 TF下我的ipython找不到我现有的matplotlib。
(tensorflow) mickeyfromd@DK-DESKTOP:~$ ipython
Python 2.7.11+(默认,2016 年 4 月 17 日,14:00:29)
在 [1] 中:import matplotlib ImportError: No module named matplotlib
4。我想设置 virtualenv,所以我只运行这个
我关注了这个网站。网站:http://help.pythonanywhere.com/pages/IPythonNotebookVirtualenvs
(tensorflow) mickeyfromd@ipython kernelspec install-self --user ...... 在 /home/mickeyfromd/.local/share/jupyter/kernels/python2 中安装 kernelspec python2
(张量流) mickeyfromd@DK-DESKTOP:~$
我无法移动文件夹(在第二步中)
如何让 ipython 拥有 Matplotlib 的路径?
【问题讨论】:
标签: matplotlib tensorflow ipython-notebook jupyter