如何解决OSError:'tor'在您的系统上不可用也许它不在您的路径中?
使用的 IDE :IntellIJ IDEA
Python应用程序的源代码:
from torrequest import TorRequest
with TorRequest() as tr:
response = tr.get('http://ipecho.net/plain')
print(response.text) # not your IP address
tr.reset_identity()
response = tr.get('http://ipecho.net/plain')
print(response.text) # another IP address,not yours
运行Python应用程序后发生错误:
C:\Users\Alex\venv\Scripts\python.exe C:/Users/Alex/IdeaProjects/torRequestExperiment/tor.py
Traceback (most recent call last): File "C:/Users/Alex/IdeaProjects/torRequestExperiment/tor.py",line 5,in <module>
with TorRequest() as tr: File "C:\Users\Alex\venv\lib\site-packages\torrequest.py",line 21,in
__init__
self._tor_proc = self._launch_tor() File "C:\Users\Alex\venv\lib\site-packages\torrequest.py",line 41,in
_launch_tor
return launch_tor_with_config( File "C:\Users\Alex\venv\lib\site-packages\stem\process.py",line 296,in launch_tor_with_config
return launch_tor(tor_cmd,args,torrc_path,completion_percent,init_msg_handler,timeout,take_ownership) File "C:\Users\Alex\venv\lib\site-packages\stem\process.py",line 103,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?
Process finished with exit code 1
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。