python3 raise ImportError('This package should not be accessible on Python 3.

当电脑上安装了Python2 和 python3时,在python3下执行help()报如下错误:

raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. 
Either you are trying to run from the python-future src folder or your installation of python-future is corrupted

这是因为环境变量中包含PYTHONPATH=/usr/local/lib/python2.7/site-packages,而这条不适用于python3。
在shell下执行

unset PYTHONPATH

即可解决

参考文献:
https://stackoverflow.com/questions/42214414/this-package-should-not-be-accessible-on-python-3-when-running-python3

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容