Search code examples
python-3.4tor

tor name not recognized in stem


I am trying to follow the "to russia with love" tutorial (https://stem.torproject.org/tutorials/to_russia_with_love.html) but I am getting this error:

[1mStarting Tor:
[0m
Traceback (most recent call last):
  File "C:\Users\gatsu\My Documents\LiClipse Workspace\TorCommunicator\tutorialStart.py", line 52, in <module>
    init_msg_handler = print_bootstrap_lines,
  File "C:\Python34\lib\site-packages\stem\process.py", line 244, in launch_tor_with_config
    return launch_tor(tor_cmd, args, torrc_path, completion_percent, init_msg_handler, timeout, take_ownership)
  File "C:\Python34\lib\site-packages\stem\process.py", line 83, in launch_tor
    raise OSError("'%s' isn't available on your system. Maybe it's not in your PATH?" % tor_cmd)
OSError: 'tor' isn't available on your system. Maybe it's not in your PATH?

What am I missing? Do I need to import something to my project or add some Tor PATH? I am using windows 8.1.


Solution

  • That means Stem doesn't know where the tor executable is located. Your PATH tells applications like Stem where to look for executables and tor isn't located in any of those locations.

    You have a couple options...

    a. Tell Stem explicitly where tor is located...

    stem.process.launch_tor_with_config(tor_cmd='C:\path\to\tor', ...)
    

    b. Change your path to include tor.