Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError in Python 3.x. #4

Open
AraHaan opened this issue Feb 19, 2017 · 1 comment
Open

SyntaxError in Python 3.x. #4

AraHaan opened this issue Feb 19, 2017 · 1 comment

Comments

@AraHaan
Copy link

AraHaan commented Feb 19, 2017

Traceback (most recent call last):
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\DecoraterBot.py", line 63, i
n <module>
    import DecoraterBotCore
ImportError: No module named 'DecoraterBotCore'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\DecoraterBot.py", line 79, i
n <module>
    import DecoraterBotCore
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\Decor
aterBotCore\__init__.py", line 25, in <module>
    from . import Core
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\Decor
aterBotCore\Core.py", line 48, in <module>
    from .web.database import Db
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\Decor
aterBotCore\web\database.py", line 2, in <module>
    import motor.motor_asyncio
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\depen
dencies.zip\motor\__init__.py", line 19, in <module>
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\win32
-deps\3.5\pymongo\__init__.py", line 83, in <module>
    from pymongo.collection import ReturnDocument
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\win32
-deps\3.5\pymongo\collection.py", line 21, in <module>
    from bson.code import Code
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\depen
dencies.zip\bson\__init__.py", line 23, in <module>
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\depen
dencies.zip\bson\codec.py", line 19, in <module>
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 954, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 896, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1139, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1115, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1096, in _legacy_get_spec
  File "<frozen importlib._bootstrap>", line 444, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 533, in spec_from_file_loc
ation
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\depen
dencies.zip\pytz\__init__.py", line 71
    raise KeyError, zone
                  ^
SyntaxError: invalid syntax
@ArneBachmann
Copy link

ArneBachmann commented Sep 12, 2017

Here are suggested solutions to Python2/3 compatibility when raising exceptions:
https://stackoverflow.com/questions/34463087/raise-exception-in-python-2-x-and-3-x
Includes a link to a re-raise explanation.
Either use a workaround or require and import the six.py library.

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

No branches or pull requests

2 participants