Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TOR with python stem (basic) - 'tor' not in PATH

I'm trying to get an .onion website's content to python, a little research showed that 'stem' and as i am running this tutorial script, or more specifically, when i'm trying to use stem.process.launch_tor_with_config, i get this error:

'tor' isn't available on your system. Maybe it's not in your PATH?

I supposed to have some sort of tor process installed, I got the tor browser bundle and put the /Tor library (with the tor.exe) in it in my path, and it's not helping... Obviously I'm missing something VERY BASIC, please advise....

Many thanks...

like image 645
Mr. Nun. Avatar asked Jul 17 '14 11:07

Mr. Nun.


1 Answers

I had the same issue on my Mac. Try specifying exactly where the tor file is located to the tor_cmd parameter:

tor_process = stem.process.launch_tor_with_config(
    tor_cmd = '/Applications/TorBrowser.app/Tor/tor.real',
    config = { SocksPort': str(SOCKS_PORT),
               'ExitNodes': '{ru}',},
    init_msg_handler = print_bootstrap_lines,
)
like image 94
abpai Avatar answered Oct 12 '22 09:10

abpai