memograph icon indicating copy to clipboard operation
memograph copied to clipboard

init_sys_streams: can't initialize sys standard streams Python runtime state: core initialized

Open aandriella opened this issue 3 years ago • 2 comments

Hi, when running python3 -m mg status I got the following error: Fatal Python error: init_sys_streams: can't initialize sys standard streams Python runtime state: core initialized Traceback (most recent call last): File "/home/antonioan/Documents/LanguageLearning/memograph/mg/io.py", line 44, in <module> AttributeError: module 'sys' has no attribute 'stdout'

aandriella avatar Jan 28 '23 10:01 aandriella

OK, I have never seen this issue, there must be some slight differences in our Python environments. A stab in the dark, your environment is conflating the memograph module mg.io with the Python internal module io (it can't find the latter after loading the former). mg.io always appears fully qualified which I think always worked for me. I have just pushed a commit in which I rename mg.io to mg.mgio to be extra safe. I hope it will fix the problem. If it does not, I am at a loss, but it will help to double check your Python version, OS, and so on. Let me know how it goes!

matomatical avatar Jan 28 '23 22:01 matomatical

I will also mention one more thing. I always run the app with python3 -m mg but yesterday when looking into issue #1 I discovered that python3 mg works fine too. The -m flag is meant to tell Python to load mg as a module rather than a script, but maybe since a recent Python update it is no longer necessary (or maybe it never was and I never noticed before). Anyway, all this to say that there may be slight differences in how Python loads the app with -m vs. without -m and it's worth trying both in case the issue is due to those differences.

matomatical avatar Jan 28 '23 22:01 matomatical