On Windows 10, I noticed that after activating an Anaconda environment, starting the python 3.9.4 interpreter, typing a few lines, quitting and restarting the interpreter, I can scroll through the history. However, there is no python_history file to be found.
The lines in the history are still accessible after deactivating the environment and reactivating it again in the same shell. However, after closing the shell, activating the environment in a new one and starting the python interpreter, the history is no longer accessible.
Where is this seemingly temporary python interpreter history stored and how does it work? As a side note: pyreadline is not installed, thus it cannot cause this behavior.
Update: In fact, the behavior is completely unrelated to Anaconda. It is simply a consequence of how Windows manages the history in the cmd terminal. Pressing F7 while in an active Python interpreter session, shows the history. The Python interpreter history is still present after terminating the interpreter but vanishes after closing the terminal. Windows PowerShell has its own way of managing the history. Here are a few links where the issue is discussed: