ipython complaining about readline

后端 未结 4 1121
时光取名叫无心
时光取名叫无心 2020-12-13 10:08

When I install ipython on my osx and run it, I get the following warning:

 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
 site-packages/I         


        
4条回答
  •  醉话见心
    2020-12-13 10:43

    If you don't mind mucking around with your PYTHONPATH, here's how you can get rid of that pesky warning:

    # move site-packages to the front of your sys.path
    import sys
    for i in range(len(sys.path)):
        if sys.path[i].endswith('site-packages'):
            path = sys.path.pop(i)
            sys.path.insert(0, path)
            break
    

    If you're using Django, you can put this in the ipython method of your site-packages/django/core/management/commands/shell.py so that it runs when you run ./manage.py shell.

提交回复
热议问题