本文介绍了AssertionError:Data Science Experience上的多个.dist-info目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在由Apache Spark服务支持的Python 3.5笔记本中,我已经使用pip安装了BigDL 0.2.删除该安装并尝试安装BigDL 0.3版时,出现此错误:(添加了换行符以提高可读性)

In a Python 3.5 notebook, backed by an Apache Spark service, I had installed BigDL 0.2 using pip. When removing that installation and trying to install version 0.3 of BigDL, I get this error: (linebreaks added for readability)

AssertionError: Multiple .dist-info directories:
/gpfs/fs01/user/scbc-4dbab79416a6ec-4cf890276e2b/.local/lib/python3.5/site-packages/BigDL-0.3.0.dist-info,
/gpfs/fs01/user/scbc-4dbab79416a6ec-4cf890276e2b/.local/lib/python3.5/site-packages/BigDL-0.2.0.dist-info

但是,这些目录都不存在:

However, neither of these directories exists:

!ls -al /gpfs/fs01/user/scbc-4dbab79416a6ec-4cf890276e2b/.local/lib/python3.5/site-packages/
total 0
drwx------ 2 scbc-4dbab79416a6ec-4cf890276e2b users 4096 Nov  8 06:12 .
drwx------ 3 scbc-4dbab79416a6ec-4cf890276e2b users 4096 Nov  8 06:12 ..

怎么了?删除旧版本的软件包后,如何安装新版本的软件包?

What's wrong? How can I install the new version of the package after removing the old one?

推荐答案

错误消息中的目录路径错误. DSX上的Python 3.5内核通过设置环境变量PIP_BUILD为pip指定了一个构建目录.有多个dist-info目录:

The directory paths in the error message are wrong. The Python 3.5 kernel on DSX specifies a build directory for pip by setting the environment variable PIP_BUILD. The multiple dist-info directories are there:

!printenv PIP_BUILD ; ls -l $PIP_BUILD/*
/tmp/scbc-4dbab79416a6ec-4cf890276e2b/pip-build
total 0
drwx------ 8 scbc-4dbab79416a6ec-4cf890276e2b users 117 Nov  7 02:02 bigdl
drwx------ 2 scbc-4dbab79416a6ec-4cf890276e2b users 135 Nov  7 02:02 BigDL-0.2.0.dist-info
drwx------ 2 scbc-4dbab79416a6ec-4cf890276e2b users 135 Nov  8 06:12 BigDL-0.3.0.dist-info

要解决此问题,请删除构建目录:

To fix the problem, remove the build directory:

!rm -rf $PIP_BUILD

之后,pip可以毫无问题地安装软件包:

After that, pip can install the package without problems:

!pip install --no-dependencies bigdl==0.3
Collecting bigdl==0.3
  Using cached BigDL-0.3.0-py2.py3-none-manylinux1_x86_64.whl
Installing collected packages: bigdl
Successfully installed bigdl

这篇关于AssertionError:Data Science Experience上的多个.dist-info目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-14 12:21