Tag Archives: anaconda

[Solved] Error: condahtterror: http 404 not found for URL

There is a problem when CONDA creates a new environment:

Solving environment: failed
CondaHTTPError: HTTP 404 NOT FOUND for url https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/noarch/repodata.json 26

Solution:

conda config --remove-key channels
conda config --append channels conda-forge --append channels bioconda --append channels defaults

[Solved] AnacondaShell Start Error: createfile()error: 5

Solution 1:

There is also a problem when you do not execute as an administrator:

CondaHTTPError: HTTP 000 CONNECTION FAILED for url

reason:

5 = access denied. See net helpmsg 5. You cannot write to the system32 folder unless you are an administrator.

Solution:

Run Anaconda shell with administrator privileges:

If you still haven’t solved the condahttpererror problem, please refer to:
CONDA create failed to create the environment httperror
the ultimate solution to the condahttpererror problem when Anaconda created the environment

Solution 2:

1. Open registry: regedit

2. Found: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System

3. Modify the key value under this path: enablelua is set from 1 to 0

VScode Run CONDA environment Error [How to Solve]

In the CONDA environment using vs code, running the program will report the following problems

conda activate base

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.

To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - cmd.exe
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

After online search, the solution is as follows. Method 2 can be used for pro test:

Method 1:

Use the anaconda navigator or Anaconda PowerShell prompt provided by Anaconda to enter the environment, or enter CONDA Bat activate “environment path”, such as CONDA batactivate”D:\Anaconda3\envs\test”

Method 2:

Step 1:

Open the administrator power shell, modify the execution policy, execute: get executionpolicy, reply restricted, indicating that the status is prohibited

Restricted – default setting, no scripts are allowed to run
allsigned – only scripts signed by digital certificates can be run
remotesigned – local scripts do not need digital signatures, but scripts downloaded from the network must have digital signatures
unrestricted – all scripts are allowed to run

Step 2:

Execute: set executionpolicy remotesigned

Step 3:

Input: CONDA init

At this time, the configuration file profile will be generated under C:\users\XXX\documents\windowspowershell ps1

After restarting the power shell or vs code, it will enter the base environment of CONDA by default

Recovery:

Delete profile ps1.

According to personal conditions, execute the set executionpolicy restricted policy and change it back to restricted.

HDF5 library version mismatched error [How to Solve]

HDF5 library version mismatched error
Error Messages:

Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.10.2, library is 1.10.5

Solution:

pip uninstall h5py
pip install h5py

[Solved] Conda install Error: An HTTP error occurred when trying to retrieve this URL. HTTP errors are often…

1. Problem Description: prepare to execute the following command in Anaconda prompt:

conda install -c stellargraph stellargraph

An HTTP error occurred when trying to retrieve this URL

HTTP errors are often intermittent, and a simple retry will get you on your way.

2. Solution: open “C:\users\your computer name\condarc

Delete all lines in condarc, copy and paste the following code, and then save:

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - defaults
show_channel_urls: true
ssl_verify: true

(anyway, I can finally succeed in this file with the above code. I don’t know if you can do it.

3. Re run

conda install -c stellargraph stellargraph
    1. as long as you don’t report an error (try it several times, it may not work well). Maybe it will take a long time. Please be patient. If you want to improve the speed, you’d better create a new virtual environment and install the software, which will be much faster

Create a new environment ( CONDA env create - n env_name ) and install the software. In this way, the compatibility with the existing software will not be considered. It can also greatly reduce the search space and improve the speed of resolving software dependencies.

Apex library Install Error: amp not installed error [How to Solve]

Problem Description:

the apex library is missing and needs to be installed! Note: do not use PIP install apex. Although it can be installed successfully, it will still be found that there are errors when running the program in the end. It can’t be used

The specific installation steps are as follows:

# When you execute git to download the apex folder, if the download is too slow, you can manually enter the URL https://github.com/NVIDIA/apex to download and unzip and perform subsequent operations
git clone https://github.com/NVIDIA/apex
cd apex
python setup.py install

After execution, if the results shown in the figure below appear, the installation is successful

Remember to collect, in case you can’t find it next time
for my sake, please give me a compliment before you leave

Conda create New environment Error: An unexpected error has occurred. Conda has prepared the above report.

Problem Description:

In Anaconda prompt (anaconda3), use the CONDA create command to create a new environment. The error is as follows:

(base) D:\OneDrive\Desktop>conda create -n my_env python==3.8
Collecting package metadata (current_repodata.json): failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 259, in _load
        raw_repodata_str = fetch_repodata_remote_request(
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 613, in fetch_repodata_remote_request
        raise Response304ContentUnchanged()
    conda.core.subdir_data.Response304ContentUnchanged

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "D:\anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__
        return func(*args, **kwargs)
      File "D:\anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "D:\anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 83, in do_call
        return getattr(module, func_name)(args, parser)
      File "D:\anaconda3\lib\site-packages\conda\cli\main_create.py", line 41, in execute
        install(args, parser, 'create')
      File "D:\anaconda3\lib\site-packages\conda\cli\install.py", line 261, in install
        unlink_link_transaction = solver.solve_for_transaction(
      File "D:\anaconda3\lib\site-packages\conda\core\solve.py", line 114, in solve_for_transaction
        unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
      File "D:\anaconda3\lib\site-packages\conda\core\solve.py", line 157, in solve_for_diff
        final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
      File "D:\anaconda3\lib\site-packages\conda\core\solve.py", line 262, in solve_final_state
        ssc = self._collect_all_metadata(ssc)
      File "D:\anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
        return f(*args, **kwds)
      File "D:\anaconda3\lib\site-packages\conda\core\solve.py", line 425, in _collect_all_metadata
        index, r = self._prepare(prepared_specs)
      File "D:\anaconda3\lib\site-packages\conda\core\solve.py", line 1020, in _prepare
        reduced_index = get_reduced_index(self.prefix, self.channels,
      File "D:\anaconda3\lib\site-packages\conda\core\index.py", line 276, in get_reduced_index
        new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 120, in query_all
        result = tuple(concat(executor.map(subdir_query, channel_urls)))
      File "D:\anaconda3\lib\concurrent\futures\_base.py", line 611, in result_iterator
        yield fs.pop().result()
      File "D:\anaconda3\lib\concurrent\futures\_base.py", line 432, in result
        return self.__get_result()
      File "D:\anaconda3\lib\concurrent\futures\_base.py", line 388, in __get_result
        raise self._exception
      File "D:\anaconda3\lib\concurrent\futures\thread.py", line 57, in run
        result = self.fn(*self.args, **self.kwargs)
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 112, in <lambda>
        subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 125, in query
        self.load()
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 189, in load
        _internal_state = self._load()
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 277, in _load
        _internal_state = self._read_local_repdata(mod_etag_headers.get('_etag'),
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 326, in _read_local_repdata
        _internal_state = self._process_raw_repodata_str(raw_repodata_str)
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 364, in _process_raw_repodata_str
        json_obj = json.loads(raw_repodata_str or '{}')
      File "D:\anaconda3\lib\json\__init__.py", line 357, in loads
        return _default_decoder.decode(s)
      File "D:\anaconda3\lib\json\decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "D:\anaconda3\lib\json\decoder.py", line 353, in raw_decode
        obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Expecting ',' delimiter: line 420202 column 26 (char 12681108)

`$ D:\anaconda3\Scripts\conda-script.py create -n my_env python==3.8`

  environment variables:
                 CIO_TEST=<not set>
                CLASSPATH=.;D:\Programming Environment\Java\java_8\lib\dt.jar;D:\Programming
                          Environment\Java\java_8\lib\tools.jar;
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=D:\anaconda3\condabin\..\Scripts\conda.exe
               CONDA_EXES="D:\anaconda3\condabin\..\Scripts\conda.exe"
             CONDA_PREFIX=D:\Anaconda3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=D:\anaconda3\python.exe
               CONDA_ROOT=D:\anaconda3
              CONDA_SHLVL=1
                CUDA_PATH=D:\Mx-yolov3\CUDAv10.0
           CURL_CA_BUNDLE=<not set>
                 HOMEPATH=\Users\MSTIFIY
          NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\
                     PATH=D:\anaconda3;D:\anaconda3\Library\mingw-w64\bin;D:\anaconda3\Library\u
                          sr\bin;D:\anaconda3\Library\bin;D:\anaconda3\Scripts;D:\anaconda3\bin;
                          D:\Anaconda3;D:\Anaconda3\Library\mingw-w64\bin;D:\Anaconda3\Library\u
                          sr\bin;D:\Anaconda3\Library\bin;D:\Anaconda3\Scripts;D:\Anaconda3\bin;
                          D:\anaconda3\condabin;D:\Mx-yolov3\CUDAv10.0\bin;D:\Mx-yolov3\CUDAv10.
                          0\libnvvp;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS;C:\WINDOWS\sy
                          stem32;C:\WINDOWS\System32;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System3
                          2\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D:\Lauguage
                          Studing\PythonSpider;C:\Program Files
                          (x86)\Google\Chrome\Application\chromedriver;D:\Programming
                          Environment\Java\java_8;D:\Lauguage
                          Studing\Android\Git\Git\cmd;D:\Programming Environment\Tesseract-
                          OCR;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance
                          Toolkit;C:\Program Files (x86)\NVIDIA
                          Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA
                          NvDLISR;D:\Lauguage Studing\Matlab\runtime\win64;D:\Lauguage
                          Studing\Matlab\bin;D:\Lauguage
                          Studing\Matlab\polyspace\bin;D:\Lauguage
                          Studing\opencv3.4.0\opencv\build\x64\vc14\bin;D:\Lauguage Studing\rasp
                          berry\putty;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
                          \WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D
                          :\anaconda3\envs\Mx_yolov3\Scripts;D:\anaconda3\envs\Mx_yolov3;D:\Andr
                          oidSDK;\platform-tools;D:\AndroidSDK;\tools;D:\Tools\cmake-3.21.2-wind
                          ows-x86_64\bin;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS\System32;C:\W
                          INDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WIN
                          DOWS\System32\OpenSSH;D:\Programming
                          Environment\python;D:\Fiddler;D:\Lauguage Studing\鐖櫕\PyCharm
                          Community Edition 2019.3.1\bin;.;D:\Programming
                          Environment\python\Scripts;C:\Program Files
                          (x86)\Google\Chrome\Application;D:\Programming
                          Environment\Java\java_8\bin;D:\Programming
                          Environment\Java\java_8\jre\bin;"D:\Programming
                          Environment\Java\java_8\bin;D:\Mx-yolov3\CUDAv10.0\bin;D:\Mx-yolov3\CU
                          DAv10.0\libnvvp;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS;C:\WIND
                          OWS\system32;C:\WINDOWS\System32;C:\WINDOWS\System32\Wbem;C:\WINDOWS\S
                          ystem32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D:\Lauguage
                          Studing\PythonSpider;C:\Program Files
                          (x86)\Google\Chrome\Application\chromedriver;D:\Programming
                          Environment\Java\java_8;D:\Lauguage
                          Studing\Android\Git\Git\cmd;D:\Programming Environment\Tesseract-
                          OCR;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance
                          Toolkit;C:\Program Files (x86)\NVIDIA
                          Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA
                          NvDLISR;D:\Lauguage Studing\Matlab\runtime\win64;D:\Lauguage
                          Studing\Matlab\bin;D:\Lauguage
                          Studing\Matlab\polyspace\bin;D:\Lauguage
                          Studing\opencv3.4.0\opencv\build\x64\vc14\bin;D:\Lauguage Studing\rasp
                          berry\putty;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
                          \WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D
                          :\anaconda3\envs\Mx_yolov3\Scripts;D:\anaconda3\envs\Mx_yolov3;D:\Andr
                          oidSDK;\platform-tools;D:\AndroidSDK;\tools;D:\Tools\cmake-3.21.2-wind
                          ows-x86_64\bin;";"D:\AndroidSDK;\platform-
                          tools;D:\AndroidSDK;\tools鈥嬧€嬧€嬧€嬧€嬧€嬧€?;D:\Programming
                          Environment\Tesseract-OCR;D:\anaconda3;C:\Users\MSTIFIY\AppData\Local\
                          Microsoft\WindowsApps;D:\Lauguage Studing\miktex\MiKTeX\miktex\bin\x64
             PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\Windows
                          PowerShell\v1.0\Modules
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : base
    active env location : D:\Anaconda3
            shell level : 1
       user config file : C:\Users\MSTIFIY\.condarc
 populated config files : C:\Users\MSTIFIY\.condarc
          conda version : 4.9.2
    conda-build version : 3.18.11
         python version : 3.8.3.final.0
       virtual packages : __cuda=10.2=0
                          __win=0=0
                          __archspec=1=x86_64
       base environment : D:\anaconda3  (writable)
           channel URLs : https://mirrors.ustc.edu.cn/anaconda/pkgs/main/win-64
                          https://mirrors.ustc.edu.cn/anaconda/pkgs/main/noarch
                          https://mirrors.ustc.edu.cn/anaconda/pkgs/free/win-64
                          https://mirrors.ustc.edu.cn/anaconda/pkgs/free/noarch
                          https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/win-64
                          https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/noarch
          package cache : D:\anaconda3\pkgs
                          C:\Users\MSTIFIY\.conda\pkgs
                          C:\Users\MSTIFIY\AppData\Local\conda\conda\pkgs
       envs directories : D:\anaconda3\envs
                          C:\Users\MSTIFIY\.conda\envs
                          C:\Users\MSTIFIY\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.3 Windows/10 Windows/10.0.19041
          administrator : False
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?

[y/N]:

Solution:

Open the .Condarc file:

channels:
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
  - https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
ssl_verify: true

Delete the mirror source of CONDA forge

channels:
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
ssl_verify: true

Create a new environment again. The operation is successful.

Condahttpererror: http 000 connection failed for URL problem in CONDA installation package

Problems occurred when using CONDA install package locally for win10
fetching package metadata... Condahttterror: http 000 connection failed for URL & lt; https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/repodata.json> ; Elapsed: - 'ssl3_ get_ server_ certificate', 'certificate verify failed')],)",),),)

First, let’s see if it’s the source problem: change the. Condarc file according to the following article
change the. Condarc file according to the link

If it still fails, it may be the problem of HTTPS protocol. Change HTTPS in. Condarc to http.

Failed to build bottleneck ERROR: Could not build wheels for bottleneck which use PEP 517

I want to import pandas in anaconda_ Profiling: the import failed. PIP install later reported the error as mentioned in the title. Later, check the stack overflow to solve the problem. Here is a record of the solution. The four steps start:

conda install bottleneck
pip install p5py
pip install pep517
pip install pycaret

Enter in your Anaconda prompt environment in turn to solve the problem.

AttributeError: module ‘pkg_resources‘ has no attribute ‘declare_namespace‘

Record a problem. Anaconda3 CONDA version 4.6.7 is installed NB_ CONDA failed and damaged the original environment, resulting in an error as shown in the title.

It is speculated that there is a problem with the dependency. First, check the piptree and find that all dependencies are satisfied. However, I manually updated setuptools during the process of CONDA update CONDA. Although the update of CONDA update CONDA failed, the version of setuptools has been updated to 58.0.0,

– setuptools [required: >=36, installed: 58.0.0]

The highest requirement is only 36. It is suspected that the version is too new and the old version is not compatible. Then I tried the degraded version

pip uninstall setuptools

pip install setuptools==36.0.2

Problem solving.

[Solved] Jupyter Kernel error: kernel Cannot Connect—-import win32api; ImportError: DLL load failed…

The kernel is not connected

Error original

Traceback (most recent call last):
  File "D:\Anaconda\envs\tf2\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\Anaconda\envs\tf2\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Anaconda\envs\tf2\lib\site-packages\ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "D:\Anaconda\envs\tf2\lib\site-packages\traitlets\config\application.py", line 844, in launch_instance
    app.initialize(argv)
  File "D:\Anaconda\envs\tf2\lib\site-packages\traitlets\config\application.py", line 87, in inner
    return method(app, *args, **kwargs)
  File "D:\Anaconda\envs\tf2\lib\site-packages\ipykernel\kernelapp.py", line 625, in initialize
    self.write_connection_file()
  File "D:\Anaconda\envs\tf2\lib\site-packages\ipykernel\kernelapp.py", line 236, in write_connection_file
    iopub_port=self.iopub_port, control_port=self.control_port)
  File "D:\Anaconda\envs\tf2\lib\site-packages\jupyter_client\connect.py", line 136, in write_connection_file
    with secure_write(fname) as f:
  File "D:\Anaconda\envs\tf2\lib\contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "D:\Anaconda\envs\tf2\lib\site-packages\jupyter_core\paths.py", line 461, in secure_write
    win32_restrict_file_to_user(fname)
  File "D:\Anaconda\envs\tf2\lib\site-packages\jupyter_core\paths.py", line 387, in win32_restrict_file_to_user
    import win32api
ImportError: DLL load failed: 找不到指定的程序。
[I 16:31:42.557 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
[IPKernelApp] ERROR | Failed to load connection file: 'C:\\Users\\YJF\\AppData\\Roaming\\jupyter\\runtime\\kernel-edcd3c8f-6a6b-4512-a376-4a71c0a0b1d5.json'
Traceback (most recent call last):
  File "D:\Anaconda\envs\tf2\lib\site-packages\ipykernel\kernelapp.py", line 261, in init_connection_file
    self.load_connection_file()
  File "D:\Anaconda\envs\tf2\lib\site-packages\jupyter_client\connect.py", line 494, in load_connection_file
    info = json.load(f)
  File "D:\Anaconda\envs\tf2\lib\json\__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "D:\Anaconda\envs\tf2\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "D:\Anaconda\envs\tf2\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "D:\Anaconda\envs\tf2\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[I 16:31:45.568 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
[IPKernelApp] ERROR | Failed to load connection file: 'C:\\Users\\YJF\\AppData\\Roaming\\jupyter\\runtime\\kernel-edcd3c8f-6a6b-4512-a376-4a71c0a0b1d5.json'
Traceback (most recent call last):
  File "D:\Anaconda\envs\tf2\lib\site-packages\ipykernel\kernelapp.py", line 261, in init_connection_file
    self.load_connection_file()
  File "D:\Anaconda\envs\tf2\lib\site-packages\jupyter_client\connect.py", line 494, in load_connection_file
    info = json.load(f)
  File "D:\Anaconda\envs\tf2\lib\json\__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "D:\Anaconda\envs\tf2\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "D:\Anaconda\envs\tf2\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "D:\Anaconda\envs\tf2\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[I 16:31:48.584 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
[IPKernelApp] ERROR | Failed to load connection file: 'C:\\Users\\YJF\\AppData\\Roaming\\jupyter\\runtime\\kernel-edcd3c8f-6a6b-4512-a376-4a71c0a0b1d5.json'
Traceback (most recent call last):
  File "D:\Anaconda\envs\tf2\lib\site-packages\ipykernel\kernelapp.py", line 261, in init_connection_file
    self.load_connection_file()
  File "D:\Anaconda\envs\tf2\lib\site-packages\jupyter_client\connect.py", line 494, in load_connection_file
    info = json.load(f)
  File "D:\Anaconda\envs\tf2\lib\json\__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "D:\Anaconda\envs\tf2\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "D:\Anaconda\envs\tf2\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "D:\Anaconda\envs\tf2\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[I 16:31:51.595 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
[IPKernelApp] ERROR | Failed to load connection file: 'C:\\Users\\YJF\\AppData\\Roaming\\jupyter\\runtime\\kernel-edcd3c8f-6a6b-4512-a376-4a71c0a0b1d5.json'
Traceback (most recent call last):
  File "D:\Anaconda\envs\tf2\lib\site-packages\ipykernel\kernelapp.py", line 261, in init_connection_file
    self.load_connection_file()
  File "D:\Anaconda\envs\tf2\lib\site-packages\jupyter_client\connect.py", line 494, in load_connection_file
    info = json.load(f)
  File "D:\Anaconda\envs\tf2\lib\json\__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "D:\Anaconda\envs\tf2\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "D:\Anaconda\envs\tf2\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "D:\Anaconda\envs\tf2\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[W 16:31:54.603 NotebookApp] KernelRestarter: restart failed
[W 16:31:54.603 NotebookApp] Kernel edcd3c8f-6a6b-4512-a376-4a71c0a0b1d5 died, removing from map.
[W 16:32:22.967 NotebookApp] Config option `template_path` not recognized by `ExporterCollapsibleHeadings`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:22.977 NotebookApp] Config option `template_path` not recognized by `ExporterCollapsibleHeadings`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.024 NotebookApp] Config option `template_path` not recognized by `TocExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.031 NotebookApp] Config option `template_path` not recognized by `TocExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.052 NotebookApp] Config option `template_path` not recognized by `LenvsHTMLExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.062 NotebookApp] Config option `template_path` not recognized by `LenvsHTMLExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.088 NotebookApp] Config option `template_path` not recognized by `LenvsTocHTMLExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.098 NotebookApp] Config option `template_path` not recognized by `LenvsTocHTMLExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.151 NotebookApp] Config option `template_path` not recognized by `LenvsLatexExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.157 NotebookApp] Config option `template_path` not recognized by `LenvsLatexExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.380 NotebookApp] Config option `template_path` not recognized by `LenvsSlidesExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.388 NotebookApp] Config option `template_path` not recognized by `LenvsSlidesExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.515 NotebookApp] Config option `template_path` not recognized by `ExporterCollapsibleHeadings`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.523 NotebookApp] Config option `template_path` not recognized by `ExporterCollapsibleHeadings`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.570 NotebookApp] Config option `template_path` not recognized by `TocExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.577 NotebookApp] Config option `template_path` not recognized by `TocExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.598 NotebookApp] Config option `template_path` not recognized by `LenvsHTMLExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.609 NotebookApp] Config option `template_path` not recognized by `LenvsHTMLExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.633 NotebookApp] Config option `template_path` not recognized by `LenvsTocHTMLExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.643 NotebookApp] Config option `template_path` not recognized by `LenvsTocHTMLExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.694 NotebookApp] Config option `template_path` not recognized by `LenvsLatexExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.700 NotebookApp] Config option `template_path` not recognized by `LenvsLatexExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.921 NotebookApp] Config option `template_path` not recognized by `LenvsSlidesExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?
[W 16:32:23.928 NotebookApp] Config option `template_path` not recognized by `LenvsSlidesExporter`.  Did you mean one of: `extra_template_paths, template_name, template_paths`?

Error reporting reason

    import win32api
ImportError: DLL load failed: The specified program could not be found.

This is caused by the incompatibility between the python version and the pywin32 version.

Solution:

Reinstall the latest version of pywin32 = = 301 in the TF2 environment with CONDA error. Solution: CONDA install pywin32 = = 301