Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Torch / Lua after installation is not working

Tags:

macos

torch

lua

I have followed the following approach in order to install Torch in my machine (Mac).

http://torch.ch/docs/getting-started.html#_

When I am done with the installation, I type:

$ luarocks install image or $ luarocks lis

or $th

in order to load the th or to make updates on the lua packages. It says "command not found". Do you have any idea how I can resolve this issue?

like image 796
user3698971 Avatar asked May 09 '15 18:05

user3698971


3 Answers

If you're on a Mac using the bash terminal, make sure that you've permanently added /Users/you/torch/install/bin to your PATH.

To do this:

  1. Navigate in your terminal to the root directory by running the command:

    $ cd
    
  2. Using the text editor of your choice (emacs, vim, etc.) open the .bash_profile file for editing. For example:

    $ emacs .bash_profile
    
  3. Add the following line to the end of the file (replacing 'you' with your Mac username):

    PATH=$PATH\:/Users/you/torch/install/bin ; export PATH
    
  4. Save and exit the text editor

  5. Source the changes by running:

    $ source .bash_profile
    
  6. Check that your PATH has been updated (look for /Users/you/torch/install/bin in the string returned):

    $ echo $PATH
    
  7. To make sure it has been changed permanently, completely quit Terminal, open it and run echo $PATH again

  8. Now try th and it should run Torch!


For more help on PATH: https://kb.iu.edu/d/acar

The Torch installation (at least for me) added the line . /Users/jb/torch/install/bin/torch-activate to my .profile file, not .bash_profile. I tried adding that exact line to .bash_profile but it didn't work, so based on the recommendations here I got rid of the trailing directory and such.

like image 162
Jacob Beauchamp Avatar answered Nov 09 '22 01:11

Jacob Beauchamp


Have you updated your PATH? It should include something like

/home/user/torch/install/bin

like image 20
Ric Avatar answered Nov 09 '22 01:11

Ric


I faced the same issue and following this post deleted and reinstalled everything. However in the end what helped was adding /home/user/torch/install/bin/ to the PATH variable.

like image 1
rttag Avatar answered Nov 09 '22 02:11

rttag