IPython sys.path different from python sys.path

后端 未结 3 1261
渐次进展
渐次进展 2020-12-19 06:12

I generally use IPython and only recently noticed that the the search path for imports is wrong in the regular python shell. From what I understand, sys.path inherits from P

3条回答
  •  感动是毒
    2020-12-19 06:55

    I had a brew installed version of Python on my mac. For some reason that couldn't use the system libraries. After brew uninstall python it worked again, because the default python was switched back to /usr/bin/python.

    Also playing around with which python, which ipython and opening up /usr/bin/python, /usr/local/bin/python, /usr/bin/ipython and /usr/local/bin/ipython and doing the imports there might help you find out where it is exactly going wrong.

提交回复
热议问题