0

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:

condanewb
  • 1
  • 1
  • Welcome to SO. If you think there is problem with " As a side note: `import readline` does not work, i.e., pyreadline is not installed.", open a new question. Always try to have a focus in your questions. – m.i.cosacak May 13 '21 at 04:42
  • @m.i.cosacak: Thanks for your remark. I updated the question. In fact, I wanted to state that the behavior is not due to pyreadline. Installing it is not a problem at all but I am wondering what is actually causing this specific behavior, i.e., in particular where the history is stored. – condanewb May 13 '21 at 18:17

0 Answers0