Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
213 views
in Technique[技术] by (71.8m points)

python - Anaconda will not launch due to UnicodeDecodeError

My Anaconda won't launch on Win 10 after running Python code and will populate the UnicodeDecodeError shown below. If I re-install Anaconda, it will launch but the same decode error would show up again.

I have tried different methods discussed in other Stackoverflow questions like update conda or install clean-conda. I have also tried to remove content from the files where the error showed up, but none of them worked.

Would really appreciate it if anyone can provide insights.

(base) C:Userszchen2>anaconda-navigator
Traceback (most recent call last):
  File "C:Userszchen2DocumentsAnaconda3Scriptsanaconda-navigator-script.py", line 10, in <module>
    sys.exit(main())
  File "C:Userszchen2DocumentsAnaconda3libsite-packagesanaconda_navigatorappmain.py", line 103, in main
    from anaconda_navigator.app.start import start_app
  File "C:Userszchen2DocumentsAnaconda3libsite-packagesanaconda_navigatorappstart.py", line 34, in <module>
    from anaconda_navigator.widgets.main_window import MainWindow
  File "C:Userszchen2DocumentsAnaconda3libsite-packagesanaconda_navigatorwidgetsmain_window.py", line 33, in <module>
    from anaconda_navigator.api.anaconda_api import AnacondaAPI
  File "C:Userszchen2DocumentsAnaconda3libsite-packagesanaconda_navigatorapianaconda_api.py", line 28, in <module>
    from anaconda_navigator.api.client_api import ClientAPI
  File "C:Userszchen2DocumentsAnaconda3libsite-packagesanaconda_navigatorapiclient_api.py", line 20, in <module>
    import binstar_client
  File "C:Userszchen2DocumentsAnaconda3libsite-packagesinstar_client\__init__.py", line 14, in <module>
    from .errors import *
  File "C:Userszchen2DocumentsAnaconda3libsite-packagesinstar_clienterrors.py", line 1, in <module>
    from clyent.errors import ClyentError
  File "C:Userszchen2DocumentsAnaconda3libsite-packagesclyent\__init__.py", line 10, in <module>
    from pkg_resources import iter_entry_points
  File "C:Userszchen2DocumentsAnaconda3libsite-packagespkg_resources\__init__.py", line 3239, in <module>
    def _initialize_master_working_set():
  File "C:Userszchen2DocumentsAnaconda3libsite-packagespkg_resources\__init__.py", line 3222, in _call_aside
    f(*args, **kwargs)
  File "C:Userszchen2DocumentsAnaconda3libsite-packagespkg_resources\__init__.py", line 3264, in _initialize_master_working_set
    tuple(
  File "C:Userszchen2DocumentsAnaconda3libsite-packagespkg_resources\__init__.py", line 3265, in <genexpr>
    dist.activate(replace=False)
  File "C:Userszchen2DocumentsAnaconda3libsite-packagespkg_resources\__init__.py", line 2778, in activate
    for pkg in self._get_metadata('namespace_packages.txt'):
  File "C:Userszchen2DocumentsAnaconda3libsite-packagespkg_resources\__init__.py", line 2762, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "C:Userszchen2DocumentsAnaconda3libsite-packagespkg_resources\__init__.py", line 1415, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "C:Userszchen2DocumentsAnaconda3libsite-packagespkg_resources\__init__.py", line 1407, in get_metadata
    return value.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 3: invalid continuation byte in namespace_packages.txt file at path: c:userszchen2documentsanaconda3libsite-packageszope.interface-5.1.2.dist-info
amespace_packages.txt

If I open namespace_packages.txt in Notepad++ and set to UTF-8 encoding, the file will show ??à/§"B°§V27. Deleting this line will allow Anaconda to launch with errors, so it would open the program selection window, but none of the program will run properly (like Jupyter Notebook).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...