Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

windows errors #16

Closed
andy144 opened this issue Aug 27, 2021 · 5 comments
Closed

windows errors #16

andy144 opened this issue Aug 27, 2021 · 5 comments

Comments

@andy144
Copy link

andy144 commented Aug 27, 2021

Hi again :)
It works fine in linux,
but I need to also install it in windows for someone.
It seems to install fine, but it throws these errors after introducing the languages in gui:

Microsoft Windows [Version 10.0.16299.98]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Windows\system32>cd c:\SRT-DeepL-Translator-master\srt_deepl

c:\SRT-DeepL-Translator-master\srt_deepl>python -m srt_deepl -g
Traceback (most recent call last):
File "c:\Users\c\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "c:\Users\c\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "c:\Users\c\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\Users\c\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\Users\c\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "c:\Users\c\AppData\Local\Programs\Python\Python39\lib\site-packages\srt_deepl_main
.py", line 112, in
translate(
File "c:\Users\c\AppData\Local\Programs\Python\Python39\lib\site-packages\srt_deepl\main.py", line 84, in translate
proxies = get_proxies()
File "c:\Users\c\AppData\Local\Programs\Python\Python39\lib\site-packages\srt_deepl\utils.py", line 6, in get_proxies
driver = webdriver.Firefox()
File "c:\Users\c\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in init
self.service.start()
File "c:\Users\c\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

What could be the problem?
Thanks in advance

@andy144
Copy link
Author

andy144 commented Aug 27, 2021

Actually now is not working in linux either.
This is the error I get:

[chi@PC ~]$ python -m srt_deepl -g
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/chi/.local/lib/python3.9/site-packages/srt_deepl/main.py", line 112, in
translate(
File "/home/chi/.local/lib/python3.9/site-packages/srt_deepl/main.py", line 84, in translate
proxies = get_proxies()
File "/home/chi/.local/lib/python3.9/site-packages/srt_deepl/utils.py", line 10, in get_proxies
table_rows = Text(driver, "XPATH", "//tr[@ROLE='row']", multiple=True).text
File "/home/chi/.local/lib/python3.9/site-packages/srt_deepl/elements.py", line 10, in init
WebDriverWait(driver, 100).until(lambda driver: find_element(*locator))
File "/usr/lib/python3.9/site-packages/selenium/webdriver/support/wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:

@andy144
Copy link
Author

andy144 commented Aug 27, 2021

I guess there is a problem with proxy servers.
I managed to make it work using 0.8.2 version (non-proxy),
but only on linux, by issuing: python main.py -g -s.

@andy144
Copy link
Author

andy144 commented Aug 29, 2021

I found latest version before 0.9.0, namely 0.8.9,
that works, but only in linux, not in windows, neither on mac.
Can you please test it in windows and/or mac and see what happens?
Or am I doing something wrong?
These are the errors I get on mac:

~ c$ python3 -m srt_deepl -g -s
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1257, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1303, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1252, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1012, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 952, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1426, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 188, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 147, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/srt_deepl/init.py", line 2, in
from .main import translate, INPUT_LANG, OUTPUT_LANG
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/srt_deepl/main.py", line 10, in
geckodriver_autoinstaller.install()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/geckodriver_autoinstaller/init.py", line 15, in install
geckodriver_filepath = utils.download_geckodriver(cwd)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/geckodriver_autoinstaller/utils.py", line 152, in download_geckodriver
geckodriver_version = get_latest_geckodriver_version()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/geckodriver_autoinstaller/utils.py", line 120, in get_latest_geckodriver_version
url = urllib.request.urlopen('https://github.com/mozilla/geckodriver/releases/latest').geturl()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1389, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1349, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)>

@andy144
Copy link
Author

andy144 commented Aug 29, 2021

Ok, I solved it by issuing these 2 commands:

pip3 install certifi
/Applications/Python\ 3.9/Install\ Certificates.command

Now it works in mac also.
Case closed.

@andy144 andy144 closed this as completed Aug 29, 2021
@sinedie
Copy link
Owner

sinedie commented Aug 30, 2021

Ok.... sry for the late reply. I'm really busy lately. Wow, that's a lot LOL.

Anyway I'm going to test it better (maybe not on Mac, cause dont own one)

Thanks for keep finding this kind of stuff. Gonna try to make some time to continue this project.

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

No branches or pull requests

2 participants