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
#21
Here how to change Environment Variables
There are User variables and System variables.
Here you see system variables Path that it point to 3.7 for me.
The same for Path in User variables
You may need to restart Pc after change,for change to take effect.
[Image: GUgLry.jpg]
Reply
#22
I think the best thing to do is to remove the environment variables PYTHONPATH and PYTHONHOME from your system.

There are better alternatives than these variables if they are needed, especially the PYTHONPATH.
Reply
#23
Very grateful to everyone here for taking time to understand problem and helping me. The error is gone now. Would have been forever stuck there if not for your useful insights. Thanks again everyone.
Reply
#24
what exactly did you do to fix it for possible future people with the same issue?
Recommended Tutorials:
Reply
#25
(Aug-22-2018, 05:19 PM)metulburr Wrote: what exactly did you do to fix it for possible future people with the same issue?
Just in case if someone again faces this exact same issue I would clarify what was the problem and how it was solved.

Initially it seemed like known python bug which happens when a file is named io.py which causes conflict with standard module io, this was clearly not case here.
Member @Gribouillis here pointed out to try executing python -E and it worked. Afterwards @metulburr again pointed out this behavior is not normal for fresh python installations. This clearly meant something was wrong with PYTHONPATH in environment variables.

What I did next was to remove all python paths from paths in environment variables(check @snippsat's screenshot for reference). Then uninstalled current python version. It is important to get rid of all paths to python installation before reinstalling because error occurred due to a invalid (likely due to change in installation directory) python path in paths. This completely solved the problem.

Also to reiterate what @Gribouillis said it was probably bad idea to add PYTHONPATH to system in first place.
Reply


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