Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

th command not working after clean install on ubuntu 16 #945

Closed
saurabhvyas opened this issue Feb 23, 2017 · 14 comments
Closed

th command not working after clean install on ubuntu 16 #945

saurabhvyas opened this issue Feb 23, 2017 · 14 comments

Comments

@saurabhvyas
Copy link

Neither luajit nor lua found in path on ubuntu after clean install
this is when I ran ./test.sh

I followed official instructions as indicated on the website

@rcplane
Copy link

rcplane commented Feb 23, 2017

Had a brief discussion with the user, at the least luarocks package was missing from install-deps

@soumith
Copy link
Member

soumith commented Feb 23, 2017

we install our own luarocks.
Before running ./test.sh, one has to run:

. ~/torch/install/bin/torch-activate

@saurabhvyas
Copy link
Author

so I have manually added lua to my environment path , and it is accessible now from terminal but I cant seem to install luarocks by following instructions from https://luarocks.org/#quick-start

The screenshot shows torch install success after removing torch directory and trying again

image

@albanD
Copy link
Contributor

albanD commented Feb 24, 2017

Since torch is doing a local install, it has to be added to your path to work. To do so, run ~/torch/install/bin/torch-activate (and add it to your bashrc).

@saurabhvyas
Copy link
Author

I tried that , I am getting this error
saurabhorange@orangepc:~/torch$ ~/torch/install/bin/torch-activate
bash: /home/saurabhorange/torch/install/bin/torch-activate: No such file or directory

@albanD
Copy link
Contributor

albanD commented Feb 25, 2017

You did run ./install.sh after running bash install-deps right? (see full innstructions here)

@saurabhvyas
Copy link
Author

saurabhvyas commented Feb 25, 2017

Yes I did , I copied those 3 lines of code line by line
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh

@albanD
Copy link
Contributor

albanD commented Feb 25, 2017

the ./install.sh command should have created a install folder in ~/torch and you should find both th and luearocks in the bin folder at ~/torch/install/bin

@saurabhvyas
Copy link
Author

unfortunately it didnt create an install folder , thats the main problem , I have tried reinstalling it multiple times , here is how folder looks
image

@albanD
Copy link
Contributor

albanD commented Feb 25, 2017

What happens when you open this folder in a terminal and run ./install.sh ?

@saurabhvyas
Copy link
Author

saurabhvyas commented Feb 25, 2017

I opened the folder in this terminal and tried running install.sh , and I saw some new commands executing ( one I didnt observe before when I copy pasted those 3 installanation commands into terminal from official docs ) and it failed because of connection timeout error of github rep ( something related to xlua) , then I ran ./clean.sh and reran ./install.sh , This time it went all green and even asked me if I wanted to add path in bashrc file , I typed yes and restarted and it works!
Thanks for the help everyone :)

image

@whiteoutmashups
Copy link

same problem, sad that nobody found a solution here.............

@stevankojic
Copy link

@wgallo3
Adding /Users/USERNAME/torch/install/bin to PATH after Torch installation worked for me so maybe you can try:

  1. Check your current PATH in terminal:
    echo $PATH
  2. If there is no 'torch path' then you need to add it to your .bash_profile (or other shell initialization file you are using) :
    nano ~/.bash_profile
  3. Add this to .bash_profile (replacing USERNAME with your user name):
#Adding Torch directory to PATH
export PATH="/Users/USERNAME/torch/install/bin:$PATH”
  1. Press CTRL-X for exit, then Y for saving, then RETURN to confirm.
  2. Restart terminal
  3. Check your PATH again:
    echo $PATH

If everything went ok you should be able to start: torch-activate, th, luajit, luarocks from terminal.

Note: .bash_profile will run only on login shells. For non-login shells, you would need to create/edit a .bashrc

@duhaime
Copy link

duhaime commented Apr 14, 2018

When I installed Torch, it added to .bashrc:

. /home/localadmin/torch/install/bin/torch-activate

Running this command in bash (or running source ~/.bashrc) gives me access to th again.

The terminal that you used when you installed Torch should contain a similar line, and sourcing the given config file should give you access to the th command again. Some possible relevant config files:

# On Linux with bash
source ~/.bashrc
# On Linux with zsh
source ~/.zshrc
# On OSX or in Linux with none of the above.
source ~/.profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants