pyzmail
pyzmail copied to clipboard
indentation error in utils.py
started using python 3.7 and when i added pyzmail to my env and run a program using it i got this error:
Traceback (most recent call last): File "d:/code/emailtrade/getsignal.py", line 3, in <module> import pyzmail File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 668, in _load_unlocked File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible File "C:\Users\death\Miniconda3\envs\emailtrade\lib\site-packages\pyzmail-1.0.3-py3.7.egg\pyzmail\__init__.py", line 7, in <module> File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 963, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 906, in _find_spec File "<frozen importlib._bootstrap_external>", line 1280, in find_spec File "<frozen importlib._bootstrap_external>", line 1254, in _get_spec File "<frozen importlib._bootstrap_external>", line 1235, in _legacy_get_spec File "<frozen importlib._bootstrap>", line 441, in spec_from_loader File "<frozen importlib._bootstrap_external>", line 594, in spec_from_file_location File "C:\Users\death\Miniconda3\envs\emailtrade\lib\site-packages\pyzmail-1.0.3-py3.7.egg\pyzmail\utils.py", line 31 b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \ ^ IndentationError: unexpected indent
Does not happen if I use the 3.6 version installed using easy_install or pip
I seem to have had similar problems just running import pyzmail from idle.
Traceback (most recent call last):
File "<pyshell#0>", line 1, in
^
IndentationError: unexpected indent
Running Python 3.7.0, installed using easy_install, got this when running import pyzmail from IDLE.
Traceback (most recent call last):
File "<pyshell#2>", line 1, in
^
IndentationError: unexpected indent
Running Python 3.7.0, installed using easy_install, got this when running import pyzmail from IDLE.
Traceback (most recent call last): File "<pyshell#2>", line 1, in import pyzmail File "C:\Program Files\Python37\lib\site-packages\pyzmail_init_.py", line 7, in from . import utils File "C:\Program Files\Python37\lib\site-packages\pyzmail\utils.py", line 31 b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' ^ IndentationError: unexpected indent
i have the same problem. can anyone help please.
Apparently for some installations the utils.py file will end up with extra newlines.
Instead of this content:
invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \
b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \
b'<>:"/\\|?*\%\''
it will be like this:
invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \
b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \
b'<>:"/\\|?*\%\''
- resulting in a syntax error.
Not sure why this happens. It definitely only happens on some computers.
For now I've bypassed the issue by manually deleting the extra newlines from the file.
Apparently for some installations the utils.py file will end up with extra newlines.
Instead of this content:
invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \ b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \ b'<>:"/\\|?*\%\''
it will be like this:
invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \ b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \ b'<>:"/\\|?*\%\''
- resulting in a syntax error.
Not sure why this happens. It definitely only happens on some computers.
For now I've bypassed the issue by manually deleting the extra newlines from the file.
Having the same issue, how were you able to find and edit this file? I can't get past the "pyzmail-1.0.3-py3.7.egg" file, and I'm looking for "venv\lib\site-packages\pyzmail-1.0.3-py3.7.egg\pyzmail\utils.py".
Writing to confirm suggestion made by @marko-knoebl is the fix. Experienced this issue across 3 completely different machines all on Python3.7.
Apparently for some installations the utils.py file will end up with extra newlines. Instead of this content:
invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \ b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \ b'<>:"/\\|?*\%\''
it will be like this:
invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \ b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \ b'<>:"/\\|?*\%\''
- resulting in a syntax error.
Not sure why this happens. It definitely only happens on some computers. For now I've bypassed the issue by manually deleting the extra newlines from the file.
Having the same issue, how were you able to find and edit this file? I can't get past the "pyzmail-1.0.3-py3.7.egg" file, and I'm looking for "venv\lib\site-packages\pyzmail-1.0.3-py3.7.egg\pyzmail\utils.py".
change .egg to .zip and access the utils.py file to edit.
Apparently for some installations the utils.py file will end up with extra newlines.
Instead of this content:
invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \ b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \ b'<>:"/\\|?*\%\''
it will be like this:
invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \ b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \ b'<>:"/\\|?*\%\''
- resulting in a syntax error.
Not sure why this happens. It definitely only happens on some computers.
For now I've bypassed the issue by manually deleting the extra newlines from the file.
Just wanted to say this worked for me (deleting the new lines in the utils.py of the pyzmail package). Did not have any issues with .egg files just opened the utils.py file in PyCharm changed it and now it works.
Thanks so much!