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

Invalid syntax issue #2

Closed
nikhila05 opened this issue Sep 7, 2017 · 3 comments
Closed

Invalid syntax issue #2

nikhila05 opened this issue Sep 7, 2017 · 3 comments

Comments

@nikhila05
Copy link

Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.5/dist-packages/imongo/main.py", line 2, in
from .kernel import MongoKernel
File "/usr/local/lib/python3.5/dist-packages/imongo/kernel.py", line 165
spawn_cmd = ['mongo', f'--eval "{prompt_cmd}; {dir_func}"']
^
SyntaxError: invalid syntax

@gusutabopb
Copy link
Owner

Could you please elaborate a bit more?

@semarf
Copy link

semarf commented Sep 29, 2017

I have the same issue, on Ubuntu 16.04, cannot start the kernel , this loops in the logs:

[I 19:03:57.050 NotebookApp] KernelRestarter: restarting kernel (4/5) WARNING:root:kernel 5895ffb2-24cb-4a4e-ab4d-b66d28032354 restarted Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.5/dist-packages/imongo/__main__.py", line 2, in <module> from .kernel import MongoKernel File "/usr/local/lib/python3.5/dist-packages/imongo/kernel.py", line 165 spawn_cmd = ['mongo', f'--eval "{prompt_cmd}; {dir_func}"'] ^ SyntaxError: invalid syntax

@gusutabopb
Copy link
Owner

IMongo only support Python 3.6+. Both @semarf and @nikhila05 seem to be using Python 3.5, which doesn't support f-strings. I will update the docs to make sure this is more explicit. In the meantime, please let me know if you have any problems with Python 3.6.

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

3 participants