6

I'm trying to install Torch7 on my mac, however the installation halts at this point:

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 

Not sure what it means. Further above I received the following output

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

However iPython is installed as I can confirm:

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

Attempting to locate the .bashrc file

%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

Jonathan March
  • 5,800
  • 2
  • 14
  • 16
WΔ_
  • 1,229
  • 4
  • 20
  • 34
  • 1) Add the suggested lines to `~/.bashrc` 2) What is the output of `env | grep PATH` ? (Add this info to your question, not in a comment.) – Jonathan March Apr 12 '15 at 01:49
  • Hey @Jonathan, I'm new to coding. What commands would I enter? Do you mean `~/.bashrc export PATH=/Users/khsiddiqui/torch/install/bin:$PATH` for instance? – WΔ_ Apr 12 '15 at 15:15
  • 1) There is a file in your home directory called `.bashrc`. Edit with a text editor (for example the Canopy editor, not a word processor like Word), adding the 3 export lines quoted in your question. – Jonathan March Apr 12 '15 at 15:22
  • 2) Open a Terminal. Type `env | grep PATH`. Copy the output to your clipboard and paste that into a code block at the end of your original question. – Jonathan March Apr 12 '15 at 15:24
  • do you know where the .bashrc file would be located? having trouble locating it through canopy editor. I could do a search through Terminal. I can't immediately see it within usr. – WΔ_ Apr 12 '15 at 16:01
  • Ah, yes, Mac is nastily stubborn about not showing you "hidden" files (whose filename begins with a period). Easiest would be from the Canopy Python panel: type `cd`, press enter, then `%edit .bashrc`, then press enter. – Jonathan March Apr 12 '15 at 18:16
  • It seems that you might not have a .bashrc file. Let's see what profile file(s) you do have. Open a Terminal, then type `ls -ld ~/.*` . What is the output? – Jonathan March Apr 13 '15 at 04:24
  • doesn't seem to be a file called .bashrc – WΔ_ Apr 13 '15 at 15:56
  • But you do have a `.profile` file, so make the same changes there (append 3 lines), using the same suggested techniques (either with `%edit` from Canopy Python panel, or with `edit` from Terminal as suggested by Tony. – Jonathan March Apr 13 '15 at 16:00
  • the 3 lines have been added. Do I need to save .profile after adding the lines? – WΔ_ Apr 13 '15 at 16:35
  • Yes. They have not actually been added until you save. – Jonathan March Apr 13 '15 at 16:38
  • what's the command for saving the .profile file. "%save .profile" ? – WΔ_ Apr 13 '15 at 16:42
  • It sounds like you have the file open in the Canopy editor. Just as with any editor or word processor etc, use the File menu's Save command (shortcut Cmd+S). BTW, you will need to take the initiative to experiment, as nobody will be able to walk you through every step. Please start by readin the user guide's getting started: http://docs.enthought.com/canopy/quick-start/gui_overview.html . Also, it would be useful to find yourself a geek buddy. – Jonathan March Apr 13 '15 at 18:03
  • thank you Jonathan, Torch is now installed! Beers on me if you're ever in Manchester, UK. – WΔ_ Apr 13 '15 at 19:21
  • Excellent. I did hike through/across Manchester many years ago, so I'll accept your offer via my time machine! – Jonathan March Apr 13 '15 at 19:27
  • haha, gr8! h.g. wells would've liked the sound of that. – WΔ_ Apr 14 '15 at 15:50

2 Answers2

6

i had a similar problem and solved it, maybe it could help others.

Here was the end of the second installation script, and the command "th" wasn't working:

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

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

This article explains how your shell profile is organized: https://serverfault.com/questions/110065/what-profile-is-my-current-shell-using

I realized in my user folder /Users/myusername/ i had a ".bash_profile" file, i pasted the line ". /Users/myusername/torch/install/bin/torch-activate" inside but didn't work (command "th" no recognized in terminal).

So in the same /Users/myusername/ folder i created a ".profile" file and pasted the line ". /Users/myusername/torch/install/bin/torch-activate" inside.

Then the command "th" works fine ;)

Community
  • 1
  • 1
  • This is easily done by executing at the terminal: `echo ". /Users/$(id -un)/torch/install/bin/torch-activate" > ~/.profile`, assuming that you installed torch to the default location. (Otherwise, just specify the correct path to the torch-activate file.) – devinbost May 18 '17 at 15:10
  • I created ".profile" and pasted the line but still "th" is not recognized.. any more tips? – aerin Sep 06 '17 at 06:14
0

First, IPython may be installed but not seen by the install process.

If you enter which ipython at a shell prompt it will tell you where it is installed. Then echo $PATH will display your PATH variable which should contain the directory that contains IPython. If it isn't then you will have to edit the PATH statement in your .bashrc file to add it.

Second, .bashrc is a file that is run by the shell when it starts up and should be in your home directory so enter cd at a shell prompt and you will be there. Then use a text editor such as Text Edit to edit it. In your case you don't have a .bashrc file, instead some things are being set in a file called .profile. You should probably check the contents of that.

Finally, I wouldn't run any of these commands from within IPython. Only run them (and the Torch install process) from the shell.

Further, I notice you have a file with the name "anaconda" in it. Have you installed 'Anaconda'?

Tony Williams
  • 613
  • 3
  • 18
  • Hey Tony, do you want me to type the three lines immediately after hitting 'cd' and [enter]? how would I exit 'cd' afterwards. – WΔ_ Apr 13 '15 at 16:38