6

我正在尝试在我的 Mac 上安装 Torch7,但此时安装停止:

Not updating your shell profile.
You might want to 
add the following lines to your shell profile:

export PATH=/Users/khsiddiqui/torch/install/bin:$PATH
export LD_LIBRARY_PATH=/Users/khsiddiqui/torch/install/lib:$LD_LIBRARY_PATH 
export    DYLD_LIBRARY_PATH=/Users/khsiddiqui/torch/install/lib:$DYLD_LIBRARY_PATH 

不知道这意味着什么。在上面我收到以下输出

echo "Error: could not find ipython in PATH. Do you have it installed?"
   fi

但是,我可以确认已安装 iPython:

No update necessary, 'ipython' is up-to-date.
ipython-3.0.0-3.egg was installed on: Thu Apr  9 18:12:32 2015


kamransiquisMBP:torch khsiddiqui$ env | grep PATH
PATH=/Users/khsiddiqui/Library/Enthought/Canopy_64bit/User/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/opt/X11/bin:
/usr/texbin

尝试定位 .bashrc 文件

%edit .bashrc
WARNING: Argument given (.bashrc) can't be found as a variable or as a filename.

kamransiquisMBP:torch khsiddiqui$ ls -ld ~/.* drwxr-xr-x+ 43 khsiddiqui staff 1462 12 Apr 01:15 /Users/khsiddiqui/. drwxr-xr-x 6 root admin 204 19 Oct 17:34 /Users/khsiddiqui/.. -r-------- 1 khsiddiqui staff 7 19 Oct 17:34 /Users/khsiddiqui/.CFUserTextEncoding -rw-r--r--@ 1 khsiddiqui staff 16388 26 Mar 23:59 /Users/khsiddiqui/.DS_Store drwxr-xr-x 3 khsiddiqui staff 102 8 Sep 2014 /Users/khsiddiqui/.R -rw-r--r-- 1 khsiddiqui staff 728832 2 Apr 17:21 /Users/khsiddiqui/.RData -rw-r--r-- 1 khsiddiqui staff 1101 20 Oct 02:58 /Users/khsiddiqui/.Rapp.history -rw-r--r-- 1 khsiddiqui staff 6314 2 Apr 17:21 /Users/khsiddiqui/.Rhistory drwx------ 22 khsiddiqui staff 748 12 Apr 01:25 /Users/khsiddiqui/.Trash -rw------- 1 khsiddiqui staff 1860 9 Apr 22:15 /Users/khsiddiqui/.bash_history drwxr-xr-x 4 khsiddiqui staff 136 9 Apr 17:57 /Users/khsiddiqui/.cache drwx------ 18 khsiddiqui staff 612 12 Apr 20:09 /Users/khsiddiqui/.canopy drwxr-xr-x 3 khsiddiqui staff 102 12 Apr 01:15 /Users/khsiddiqui/.conda drwxr-xr-x 2 khsiddiqui staff 68 12 Apr 01:11 /Users/khsiddiqui/.continuum drwx------ 3 khsiddiqui staff 102 30 Jul 2010 /Users/khsiddiqui/.cups drwx------ 10 khsiddiqui staff 340 2 Apr 17:26 /Users/khsiddiqui/.dropbox -rw-r--r-- 1 khsiddiqui staff 2525 12 Apr 16:56 /Users/khsiddiqui/.enstaller4rc drwxr-xr-x 9 khsiddiqui staff 306 9 Apr 22:25 /Users/khsiddiqui/.ipython drwxr-xr-x 4 khsiddiqui staff 136 12 Apr 16:57 /Users/khsiddiqui/.matplotlib -rw-r--r-- 1 khsiddiqui staff 340 12 Apr 01:12 /Users/khsiddiqui/.profile -rw-r--r-- 1 khsiddiqui staff 251 28 Mar 13:45 /Users/khsiddiqui/.profile-anaconda.bak drwxr-xr-x 15 khsiddiqui staff 510 2 Apr 17:21 /Users/khsiddiqui/.rstudio-desktop drwxr-xr-x 6 khsiddiqui staff 204 20 Oct 19:21 /Users/khsiddiqui/.subversion -rw------- 1 khsiddiqui staff 625 9 Apr 21:33 /Users/khsiddiqui/.viminfo

4

2 回答 2

6

我有一个类似的问题并解决了它,也许它可以帮助其他人。

这是第二个安装脚本的结尾,命令“th”不起作用:

Not updating your shell profile.
You might want to
add the following lines to your shell profile:

. /Users/myusername/torch/install/bin/torch-activate

本文解释了您的 shell 配置文件的组织方式:https ://serverfault.com/questions/110065/what-profile-is-my-current-shell-using

我意识到在我的用户文件夹 /Users/myusername/ 我有一个“.bash_profile”文件,我在里面粘贴了行“./Users/myusername/torch/install/bin/torch-activate”但没有工作(命令“ th" 在终端中无法识别)。

因此,在同一个 /Users/myusername/ 文件夹中,我创建了一个“.profile”文件并在其中粘贴了“./Users/myusername/torch/install/bin/torch-activate”行。

然后命令“th”工作正常;)

于 2015-12-06T19:44:32.507 回答
0

首先,IPython 可能已安装但安装过程看不到。

如果你which ipython在 shell 提示符下输入,它会告诉你它的安装位置。然后echo $PATH将显示您的 PATH 变量,该变量应包含包含 IPython 的目录。如果不是,那么您将不得不编辑 .bashrc 文件中的 PATH 语句来添加它。

其次,.bashrc是一个在 shell 启动时由 shell 运行的文件,它应该在你的主目录中,所以cd在 shell 提示符下输入,你就会在那里。然后使用文本编辑器(例如 Text Edit)对其进行编辑。在您的情况下,您没有.bashrc文件,而是在名为.profile. 您可能应该检查其中的内容。

最后,我不会在 IPython 中运行任何这些命令。仅从 shell 运行它们(和 Torch 安装过程)。

此外,我注意到您有一个名为“anaconda”的文件。你安装了“Anaconda”吗?

于 2015-04-12T22:50:44.853 回答