Solution to error reporting of CONDA virtual environment due to system environment variables

Due to IDA settings, the system environment variable pythonhome needs to be provided. It is configured as e: \ anaconda3 on this machine, including version Python 3.8

However, after using CONDA to create a new environment Python 3.5, the python environment is still Python 3.8, resulting in a series of problems such as Python unable to start

Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "E:\Anaconda3\lib\io.py", line 52, in <module>
  File "E:\Anaconda3\lib\abc.py", line 106
    print(f"Class: {cls.__module__}.{cls.__qualname__}", file=file)

Solution: set the virtual environment variable to null after activating e: \ py35 to start the virtual environment

conda env config vars set PYTHONHOME=""
conda deactivate

Activate again to solve the problem. The same is true for other Python versions

Similar Posts: