WARNING: IPython History requires SQLite, your history will not be saved

前端 未结 5 1247
小蘑菇
小蘑菇 2021-01-31 20:54

Hi I\'m using Ubuntu release 12.10 (quantal) 32-bit with Linux Kernel 3.5.0-21-generic. I\'m trying to get IPython\'s History to work. I\'ve set it up using pythonbrew and a vir

5条回答
  •  深忆病人
    2021-01-31 21:52

    Thanks to minrk for pointing me in the right direction. All I had to do was rebuild python. I've outlined the steps below for those that are using pythonbrew. Notice that I already installed the libsqlite3-dev package up in the question section.

    First, with the proper version of python and virtual environment loaded up run the command:

    $ pip freeze -l > requirements.txt
    

    This gives us a text file list of all of the pip packages that have been installed in the virtual environment for this particular python release in pythonbrew. Then we remove the version of python from pythonbrew and reinstall it (this is the "rebuild python" step):

    $ pythonbrew uninstall 2.7.3
    $ pythonbrew install 2.7.3
    

    After that, we switch over to the newly installed python version 2.7.3 and create a new virtual environment (which I've called "sci"):

    $ pythonbrew switch 2.7.3
    $ pythonbrew venv create sci
    $ pythonbrew venv use sci
    

    Ideally you should be able to run the command:

    $ pip install -r requirements.txt
    

    and according to this pip should reinstall all the modules that you had in the virtual environment before we clobbered that version of python (2.7.3). It didn't work for me for whatever reason so I manually installed all of the modules using pip individuality.

    $ ipython --pylab
    
    Python 2.7.3 (default, Jan  5 2013, 18:48:27) 
    Type "copyright", "credits" or "license" for more information.
    
    IPython 0.13.1 -- An enhanced Interactive Python.
    ?         -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help      -> Python's own help system.
    object?   -> Details about 'object', use 'object??' for extra details.
    

    and IPython history works!

提交回复
热议问题