SyntaxError: multiple exception types must be parenthesized #38

Closed
opened 2023-09-11 05:16:16 +00:00 by matharu · 4 comments

Hello! I'm trying to set-up ARTEMiS on Ubuntu 22.04.3 LTS, and I'm following the Read-Me for the OS (even though the Read-Me says 20.04).
Everything worked fine, until I got to the Create the database tables for ARTEMiS part.
Trying to run sudo python3 dbutils.py create gives me a SyntaxError.
Trying to run the ARTEMiS instance causes the same set of errors...
Here's the full Traceback:

Traceback (most recent call last):
File "/home/matharu/Documentos/artemis/index.py", line 8, in
from core import *
File "/home/matharu/Documentos/artemis/core/__init__.py", line 2, in
from core.allnet import AllnetServlet
File "/home/matharu/Documentos/artemis/core/allnet.py", line 9, in
from Crypto.PublicKey import RSA
File "/usr/local/lib/python3.10/dist-packages/Crypto/PublicKey/RSA.py", line 585
except ValueError, IndexError:
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized

Any clues//advices on how to continue?
Thanks!

Hello! I'm trying to set-up ARTEMiS on Ubuntu 22.04.3 LTS, and I'm following the Read-Me for the OS (even though the Read-Me says 20.04). Everything worked fine, until I got to the `Create the database tables for ARTEMiS` part. Trying to run `sudo python3 dbutils.py create` gives me a `SyntaxError`. Trying to run the ARTEMiS instance causes the same set of errors... Here's the full Traceback: > Traceback (most recent call last): File "/home/matharu/Documentos/artemis/index.py", line 8, in <module> from core import * File "/home/matharu/Documentos/artemis/core/`__init__`.py", line 2, in <module> from core.allnet import AllnetServlet File "/home/matharu/Documentos/artemis/core/allnet.py", line 9, in <module> from Crypto.PublicKey import RSA File "/usr/local/lib/python3.10/dist-packages/Crypto/PublicKey/RSA.py", line 585 except ValueError, IndexError: ^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: multiple exception types must be parenthesized Any clues//advices on how to continue? Thanks!
Collaborator

Hello matharu,

This issue is usually because you have an obsolete package or the wrong package for the crypto

Run those commands in order

pip uninstall PyCrypto
pip uninstall PyCryptodome
pip install PyCryptodome

Hello matharu, This issue is usually because you have an obsolete package or the wrong package for the crypto Run those commands in order pip uninstall PyCrypto pip uninstall PyCryptodome pip install PyCryptodome
Author

Hey Midorica! Doing that solved the issue. Looks like that part of the Read-Me is "deprecated" since it advises to install PyCrypto instead of PyCryptodome

However... I ran into another issue. When trying to Create the database tables and/or run ARTEMiS' interface, I am met with another error. An ImportError, I believe. Here's the Traceback:

matharu@matharu-vostro-3450:~/Documentos/artemis$ sudo python3 dbutils.py create
[2023-09-12 00:58:44] INFO | Database | Creating databases...
get_all_titles: pokken - cannot import name 'builder' from 'google.protobuf.internal' (/usr/lib/python3/dist-packages/google/protobuf/internal/__init__.py)
Traceback (most recent call last):
File "/home/matharu/Documentos/artemis/dbutils.py", line 52, in
data.create_database()
File "/home/matharu/Documentos/artemis/core/data/database.py", line 88, in create_database
games = Utils.get_all_titles()
File "/home/matharu/Documentos/artemis/core/utils.py", line 18, in get_all_titles
mod = importlib.import_module(f"titles.{dir}")
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/matharu/Documentos/artemis/titles/pokken/__init__.py", line 1, in
from .index import PokkenServlet
File "/home/matharu/Documentos/artemis/titles/pokken/index.py", line 16, in
from .base import PokkenBase
File "/home/matharu/Documentos/artemis/titles/pokken/base.py", line 9, in
from .proto import jackal_pb2
File "/home/matharu/Documentos/artemis/titles/pokken/proto/jackal_pb2.py", line 5, in
from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (/usr/lib/python3/dist-packages/google/protobuf/internal/__init__.py)

Any help on that? Appreciate any!
Thank you!

Hey Midorica! Doing that solved the issue. Looks like that part of the Read-Me is "deprecated" since it advises to install `PyCrypto` instead of `PyCryptodome` However... I ran into another issue. When trying to Create the database tables and/or run ARTEMiS' interface, I am met with another error. An ImportError, I believe. Here's the Traceback: > matharu@matharu-vostro-3450:~/Documentos/artemis$ sudo python3 dbutils.py create [2023-09-12 00:58:44] INFO | Database | Creating databases... get_all_titles: pokken - cannot import name 'builder' from 'google.protobuf.internal' (/usr/lib/python3/dist-packages/google/protobuf/internal/`__init__`.py) Traceback (most recent call last): File "/home/matharu/Documentos/artemis/dbutils.py", line 52, in <module> data.create_database() File "/home/matharu/Documentos/artemis/core/data/database.py", line 88, in create_database games = Utils.get_all_titles() File "/home/matharu/Documentos/artemis/core/utils.py", line 18, in get_all_titles mod = importlib.import_module(f"titles.{dir}") File "/usr/lib/python3.10/importlib/`__init__`.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/home/matharu/Documentos/artemis/titles/pokken/`__init__`.py", line 1, in <module> from .index import PokkenServlet File "/home/matharu/Documentos/artemis/titles/pokken/index.py", line 16, in <module> from .base import PokkenBase File "/home/matharu/Documentos/artemis/titles/pokken/base.py", line 9, in <module> from .proto import jackal_pb2 File "/home/matharu/Documentos/artemis/titles/pokken/proto/jackal_pb2.py", line 5, in <module> from google.protobuf.internal import builder as _builder ImportError: cannot import name 'builder' from 'google.protobuf.internal' (/usr/lib/python3/dist-packages/google/protobuf/internal/`__init__`.py) Any help on that? Appreciate any! Thank you!
Collaborator

Simply run those 2 commands:

pip uninstall protobuf
pip install protobuf==4.22.0

Simply run those 2 commands: pip uninstall protobuf pip install protobuf==4.22.0
Author

It worked! Right now, I'm just testing the server to see if everything works, but when I run the ARTEMiS interface without anything connected to it, it's supposed to be like this, correct?

matharu@matharu-vostro-3450:~/Documentos/artemis$ sudo python3 index.py
[2023-09-12 01:21:11] Core | INFO | ARTEMiS starting in develop mode
IDZ: No RSA/AES keys! IDZ cannot start
[2023-09-12 01:21:12] Allnet | INFO | Serving 17 game codes port 80
IDZ: No RSA/AES keys! IDZ cannot start
[2023-09-12 01:21:12] CXB | INFO | Ready on port 8082
[2023-09-12 01:21:12] Title | INFO | Serving 17 game codes on port 8080
[2023-09-12 01:21:12] Mucha | INFO | Serving 2 games
[2023-09-12 01:21:12] Aimedb | INFO | Ready on port 22345

Thank you so much Midorica! I'd be banging my head on the wall until now if I were by myself to solve this since I don't have that much experience with troubleshooting 😅
Thank you very much once again!

It worked! Right now, I'm just testing the server to see if everything works, but when I run the ARTEMiS interface without anything connected to it, it's supposed to be like this, correct? > matharu@matharu-vostro-3450:~/Documentos/artemis$ sudo python3 index.py [2023-09-12 01:21:11] Core | INFO | ARTEMiS starting in develop mode IDZ: No RSA/AES keys! IDZ cannot start [2023-09-12 01:21:12] Allnet | INFO | Serving 17 game codes port 80 IDZ: No RSA/AES keys! IDZ cannot start [2023-09-12 01:21:12] CXB | INFO | Ready on port 8082 [2023-09-12 01:21:12] Title | INFO | Serving 17 game codes on port 8080 [2023-09-12 01:21:12] Mucha | INFO | Serving 2 games [2023-09-12 01:21:12] Aimedb | INFO | Ready on port 22345 Thank you so much Midorica! I'd be banging my head on the wall until now if I were by myself to solve this since I don't have that much experience with troubleshooting 😅 Thank you very much once again!
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Hay1tsme/artemis#38
No description provided.