0

my project can't make import idk why the error is showing

seifahmed15@Ubuntu:~/Desktop/DAC-master$ python3 main.py
Traceback (most recent call last):
  File "/home/seifahmed15/Desktop/DAC-master/main.py", line 2, in <module>
    from user import create
  File "/home/seifahmed15/Desktop/DAC-master/user.py", line 5, in <module>
    import hcaptcha
  File "/home/seifahmed15/Desktop/DAC-master/hcaptcha.py", line 6, in <module>
    from seleniumwire.undetected_chromedriver import Chrome
  File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/undetected_chromedriver/__init__.py", line 9, in <module>
    from seleniumwire.webdriver import Chrome
  File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/webdriver.py", line 13, in <module>
    from seleniumwire import backend
  File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/backend.py", line 4, in <module>
    from seleniumwire.server import MitmProxy
  File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/server.py", line 4, in <module>
    from seleniumwire.handler import InterceptRequestHandler
  File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/handler.py", line 5, in <module>
    from seleniumwire import har
  File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/har.py", line 11, in <module>
    from seleniumwire.thirdparty.mitmproxy import connections
  File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/thirdparty/mitmproxy/connections.py", line 9, in <module>
    from seleniumwire.thirdparty.mitmproxy.net import tls, tcp
  File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/thirdparty/mitmproxy/net/tls.py", line 43, in <module>
    "SSLv2": (SSL.SSLv2_METHOD, BASIC_OPTIONS),
              ^^^^^^^^^^^^^^^^
AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'. Did you mean: 'SSLv23_METHOD'?

i have reinstall python and tried to install pkg manually i have searched on google and YouTube and i didn't find any thing

1 Answers1

0

The console message below offers a bit more context on one issue, specifically on line 43:

File "/home/seifahmed15/.local/lib/python3.11/site-packages/seleniumwire/thirdparty/mitmproxy/net/tls.py", line 43, in <module>
    "SSLv2": (SSL.SSLv2_METHOD, BASIC_OPTIONS),
              ^^^^^^^^^^^^^^^^
AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'. Did you mean: 'SSLv23_METHOD'?

It looks like you may have a typo in the area below:

"SSLv2": (SSL.SSLv2_METHOD, BASIC_OPTIONS)

As the error message tells us:

'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'. Did you mean: 'SSLv23_METHOD'?

You could try revising like below:

"SSLv2": (SSL.SSLv23_METHOD, BASIC_OPTIONS)

The other text in your console log appears to be showing the full stack trace - There may be an error elsewhere, but the error message you posted seems to be referencing that specific error on line 43.

The thread below may help a bit with handling the stack trace and debugging further:

Get exception description and stack trace which caused an exception, all as a string

jrynes
  • 187
  • 1
  • 9
  • It looks like you made a mistake reading the error. The text `lib/python3.11/site-packages` indicates that the issue is in a package code, not anything he wrote. – Further_Reading Jul 24 '23 at 10:32