gpt4 book ai didi

python-2.7 - Ipython 破坏了 : doesn't start, 说缺少 'pathlib2' 分布

转载 作者:行者123 更新时间:2023-12-04 16:33:29 25 4
gpt4 key购买 nike

当我在终端中执行 ipython 时,我看到以下错误

aman@ebex-MacBookPro:~/ipython_work$ ipython                                                                                       
Traceback (most recent call last):
File "/usr/local/bin/ipython", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3141, in <module>
@_call_aside
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3127, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3154, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 640, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 941, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 828, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pathlib2' distribution was not found and is required by ipython

就在那之前我跟着
 $ git clone --recursive https://github.com/ipython/ipython.git
$ cd ipython
$ pip install -e ".[notebook]"

从链接 [如何自动保存 ipython 笔记本]
http://stackoverflow.com/questions/21517296/how-to-autosave-ipython-notebook

我尝试使用 apt-get 卸载和安装,但它仍然无法正常工作并抛出丢失的分发错误。

虽然我安装了 pathlib2
sudo pip install pathlib2

但是在访问 ipython 时再次
我看到另一个错误
pkg_resources.DistributionNotFound: The 'backports.shutil_get_terminal_size' distribution was not found and is required by ipython

最佳答案

您需要手动安装一些软件包,如下所示:

pip install pathlib2
pip install backports.shutil_get_terminal_size
pip install enum34

关于python-2.7 - Ipython 破坏了 : doesn't start, 说缺少 'pathlib2' 分布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37299319/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com