Python Forum
Fatal Python error: Py_Initialize: unable to load the file system codec
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fatal Python error: Py_Initialize: unable to load the file system codec
#1
Hi,

I am using the terminal on a OS X El Capitan. Recently I have used python to run some software until I got some error and started updating the python versions to 3.5... through brew.

Error:
Traceback (most recent call last): File "/Users/samsa2/python_scripts/DIAMOND_subsystems_analysis_counter.py", line 119, in <module> for line in db: File "/Users/miniconda3/lib/python3.5/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 3173: invalid start byte
And now every time I run or try to activate an environment I have the following error:

Error:
Fatal Python error: Py_Initialize: unable to load the file system codec Traceback (most recent call last): File “/Users/user1/miniconda3/lib/python3.5/encodings/init.py”, line 31, in <module> File “/Users/user1/miniconda3/lib/python3.5/codecs.py”, line 322, in <module> NameError: name ‘open’ is not defined
I suspect I have installed different versions of python and there are problems with the PATH environment variable
When running "which python"
Quote:/Users/user1/miniconda3/bin/python

And my echo $PATH seems to be this
Quote:/usr/local/share/python:/Users/ecg1g15/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

1. What is the best way to make python work again?
2. Is there anyway I could uninstall all python versions and install the one I desire (ideally 2.7)?

Thanks in advance

E
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Failed attempts to load Microsoft Appstore Python DLLs piyushd 0 394 Oct-31-2023, 10:43 AM
Last Post: piyushd
  FileNotFoundError: [WinError 2] The system cannot find the file specified NewBiee 2 1,496 Jul-31-2023, 11:42 AM
Last Post: deanhystad
  [SOLVED] [Debian] UnicodeEncodeError: 'ascii' codec Winfried 1 988 Nov-16-2022, 11:41 AM
Last Post: Winfried
  pygame image load error Yegor123 1 1,488 Oct-12-2022, 05:36 AM
Last Post: deanhystad
  How to load all pages of the pdf file to the program alicenguyen 9 2,195 Jul-04-2022, 03:14 AM
Last Post: alicenguyen
  unable to load an image with C (Cython) HLD202 0 1,280 Jan-13-2022, 09:16 PM
Last Post: HLD202
  Unable to upload file using FTP korenron 2 2,422 Dec-23-2021, 12:44 PM
Last Post: korenron
  Handling Python Fatal Error richajain1785 7 5,764 Oct-14-2021, 01:34 PM
Last Post: Tails86
  ASCII-Codec in Python3 [SOLVED] AlphaInc 4 5,991 Jul-07-2021, 07:05 PM
Last Post: AlphaInc
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 error from Mysql call AkaAndrew123 1 3,387 Apr-28-2021, 08:16 AM
Last Post: AkaAndrew123

Forum Jump:

User Panel Messages

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