New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No history in python3 inside the virtualenv #90

Phyks opened this Issue Jan 25, 2016 · 3 comments


None yet
3 participants
Copy link

Phyks commented Jan 25, 2016


Not sure if this issue is pew-specific or not, but I could not find much information on it… Inside a virtualenv (pew workon venv), I do not have history across different calls of Python.

Is it expected? Is there a way to recover an history?



This comment has been minimized.

Copy link

berdario commented Jan 29, 2016

This is a known Virtualenv bug

I already noticed it before, but I didn't dig to the root cause.

The only solution is a rewrite of virtualenv

I think that adapting virtualenv-rewrite might work.


This comment has been minimized.

Copy link

Phyks commented Jan 29, 2016

Ok, will follow this issue. Thanks!


This comment has been minimized.

Copy link

Lucas-C commented Jun 30, 2016

As a workaround, here is my .pythonrc (loaded thanks to export PYTHONSTARTUP=~/.pythonrc) :

import atexit, os, readline, sys
if sys.version_info >= (3, 0) and hasattr(sys, 'real_prefix'): # in a VirtualEnv
    PYTHON_HISTORY_FILE = os.path.join(os.environ['HOME'], '.python_history')
    if os.path.exists(PYTHON_HISTORY_FILE):
        atexit.register(readline.write_history_file, PYTHON_HISTORY_FILE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment