Python Forum
Fatal Python error: init_sys_streams: can't initialize sys standard streams Attribute
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fatal Python error: init_sys_streams: can't initialize sys standard streams Attribute
#1
Python 3 installation was working fine until yesterday. Then this happened today. Output from command prompt (Windows 10) when I type Python:

Fatal Python error: init_sys_streams: can't initialize sys standard streams
AttributeError: module 'io' has no attribute 'OpenWrapper'

Current thread 0x00001204 (most recent call first):
Googled and searched thoroughly for answers in previous questions nothing seems to be helping.

Just in case if relevant, used Python 3 with VS code before this.

Also tried uninstalling current Python(3.6.5) and reinstall latest Python(3.7.0) but error still persists. Any help would be appreciated.
Reply
#2
What was your method of installation?
What did you name your py file in VS Code?
What python versions are installed?
Which python version did you run from terminal and which version is connected to VS Code?
Are you using straight python or something like Anaconda Python?

EDIT:
please inform us of other forums you have posted to so we dont run through the same questions
cross posted here
https://stackoverflow.com/questions/5195...reams-attr
Recommended Tutorials:
Reply
#3
I installed through Python 3.7.0 Windows installer found on python.org

About second question, while error initially did occur when I tried to run a script through VS terminal, it doesn't seems to be specific to any particular script. For eg: When I try to open a separate terminal and try getting into IDLE by typing 'python', it still throws up same error. Just to be sure I tried executing multiple .py scripts through same but still that error.

Currently only python version installed is Python 3.7.0.

Version connected to VS Code was same as the default one installed in Windows (only have one version of Python installed).

I am using straight Python.

Sorry about that. Couldn't find any solutions to this even after extensive searching. Just trying to get as much help as possible. Apart from that I also posted the problem here
https://www.reddit.com/r/learnpython/com...n_3_error/

Any help in this regard would be appreciated. Thanks.
Reply
#4
For right now i am going to ignore VS Code as even if a python install is messed up you can always install a fresh one along side it and it will work from the terminal without issues.

Quote:Well after you said that , I uninstalled python once more and did a fresh vanilla install in different directory. Still same error. Really confused now. Am I missing something?
What happens if you uninstall python completely and and run python from the command prompt. The expected output should be no command, but im curious if you still get that error. When i say command prompt i mean Window 10's command prompt. Do not do it from an IDE.
Recommended Tutorials:
Reply
#5
Yes you're right about that expected output part. Because I get:
'python' is not recognized as an internal or external command,
operable program or batch file.
So no error when I completely uninstall it. Do you think there's some specific problem with my system? Because error reappears no matter how many time I install/uninstall even in different directories. Also using windows 10 cmd not IDE.
Reply
#6
Find all the files in the filesystem named io.py or io.pyc or io.pyo, io.pyd etc
Reply
#7
(Aug-22-2018, 06:18 AM)Gribouillis Wrote: Find all the files in the filesystem named io.py or io.pyc or io.pyo, io.pyd etc
Thats what i initially thought based on the attribute error. But i have never seen the fatal error msg before when someone creates a named python standard library file. So i am kinda stumped.

Quote:Fatal Python error: init_sys_streams: can't initialize sys standard streams
AttributeError: module 'io' has no attribute 'OpenWrapper'

Current thread 0x00001204 (most recent call first):

I am curious as to what others might think of this issue, and the solution now.
Recommended Tutorials:
Reply
#8
(Aug-22-2018, 12:48 AM)FatalPythonError Wrote: error initially did occur when I tried to run a script through VS terminal
what was the name and exact location of this script?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#9
(Aug-22-2018, 12:16 PM)metulburr Wrote: But i have never seen the fatal error msg before when someone creates a named python standard library file. So i am kinda stumped.
@metulburr You can look at the C code of init_sys_stream() to understand where the message comes from. Basically the code does the C equivalent of io.OpenWrapper and fails to retrieve the attribute. So it is really an attribute error, which means that something else than the standard module io was imported.
Reply
#10
Make the error.
C:\Users\Tom
λ python
Fatal Python error: init_sys_streams: can't initialize sys standard streams
AttributeError: module 'io' has no attribute 'OpenWrapper'

Current thread 0x000070ac (most recent call first):
So changed content of io.py in C:\Python37\Lib.

The default path is not good C:\Users\<your_user_name>\AppData\Local\Programs\Python\Python36-32
As AppData is hided for normal use,so have to un-hide and look for io.py.

Try follow Python 3.6/3.7 and pip installation under Windows
So there not using the default path,but place for simpler access eg c:\python37
Then try python from cmd again.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error: audioio has no attribute 'AudioOut' netwrok 3 644 Oct-22-2023, 05:53 PM
Last Post: netwrok
  cx_oracle Error - AttributeError: 'function' object has no attribute 'cursor' birajdarmm 1 2,367 Apr-15-2023, 05:17 PM
Last Post: deanhystad
  python standard way of importing library mg24 1 905 Nov-15-2022, 01:41 AM
Last Post: deanhystad
  Running Standard Scaler in Python 3 Led_Zeppelin 1 1,276 Sep-05-2022, 06:35 PM
Last Post: deanhystad
  Handling Python Fatal Error richajain1785 7 5,909 Oct-14-2021, 01:34 PM
Last Post: Tails86
  Getting 'NoneType' object has no attribute 'find' error when WebScraping with BS Franky77 2 5,269 Aug-17-2021, 05:24 PM
Last Post: Franky77
  2 ways to initialize a list with all zero quazirfan 2 1,808 Aug-06-2021, 03:27 PM
Last Post: deanhystad
  Attribute Error received not understood (Please Help) crocolicious 5 2,688 Jun-19-2021, 08:45 PM
Last Post: crocolicious
  error in scapy attribute 'haslayer' evilcode1 5 6,541 Mar-02-2021, 11:19 AM
Last Post: evilcode1
  Fatal error after trying to play sound. giladal 0 1,932 Oct-22-2020, 10:27 AM
Last Post: giladal

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020