我们环境中的 anaconda 版本为“anaconda3-2018”。由于存在安全漏洞,我们强制删除了 pyspark、sqlalchemy 和请求,因为在尝试删除以下软件包时 conda remove 不起作用。/opt/cloudera/extras/anaconda3-2018/bin/conda remove --force-remove pyspark /opt/cloudera/extras/anaconda3-2018/bin/conda remove --force-remove sqlalchemy /opt/cloudera/extras/anaconda3-2018/bin/conda remove --force-remove 请求删除上述软件包后,我们无法将任何软件包安装到 anaconda3-2018。我们计划安装“gensim-3.4.0-py37h14c3975_0.tar.bz2”、“pytorch-1.0.1-cuda92py37h65efead_0.tar.bz2”和“linux-64/gensim-3.4.0-py37h14c3975_0.tar.bz2”,对于我们遇到的任何错误,请提出建议 [root@l51hdvmi-03 pbibhu]# /opt/cloudera/extras/anaconda3-2018/bin/conda install pytorch-1.0.1-cuda92py37h65efead_0.tar.bz2
>>>>>>>>>>>>>>>>>>>>>> 错误报告 <<<<<<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/conda/gateways/connection/__init__.py", line 21, in <module>
from requests import ConnectionError, HTTPError, Session
ModuleNotFoundError: No module named 'requests'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/conda/exceptions.py", line 1003, in __call__
return func(*args, **kwargs)
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/conda/cli/main.py", line 84, in _main
exit_code = do_call(args, p)
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 80, in do_call
module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/conda/cli/main_install.py", line 8, in <module>
from .install import install
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/conda/cli/install.py", line 18, in <module>
from ..core.index import calculate_channel_urls, get_index
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/conda/core/index.py", line 10, in <module>
from .package_cache_data import PackageCacheData
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 15, in <module>
from .path_actions import CacheUrlAction, ExtractPackageAction
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/conda/core/path_actions.py", line 31, in <module>
from ..gateways.connection.download import download
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/conda/gateways/connection/__init__.py", line 38, in <module>
from pip._vendor.requests import ConnectionError, HTTPError, Session
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/pip/_vendor/requests/__init__.py", line 94, in <module>
from pip._internal.utils.compat import WINDOWS
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/pip/_internal/__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py", line 12, in <module>
from pip._internal.commands import (
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/pip/_internal/commands/__init__.py", line 6, in <module>
from pip._internal.commands.completion import CompletionCommand
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/pip/_internal/commands/completion.py", line 6, in <module>
from pip._internal.cli.base_command import Command
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 18, in <module>
from pip._internal.download import PipSession
File "/opt/cloudera/extras/anaconda3-2018/lib/python3.7/site-packages/pip/_internal/download.py", line 325, in <module>
class PipSession(requests.Session):
AttributeError: module 'pip._vendor.requests' has no attribute 'Session'
$ /opt/cloudera/extras/anaconda3-2018/bin/conda install pytorch-1.0.1-cuda92py37h65efead_0.tar.bz2
环境变量:CASP_BIN_PATH=/opt/CA/UnicenterNSM/bin CASP_LIB_PATH=/opt/CA/UnicenterNSM/lib CASP_PATH=/opt/CA/UnicenterNSM CA_DIA_JREPATH=/opt/CA/SharedComponents/JRE/1.7.0_25 CIO_TEST= CONDA_ROOT=/opt/cloudera/extras/anaconda3-2018 LD_LIBRARY_PATH=/opt/CA/SharedComponents/lib:/opt/CA/CAlib:/opt/CA/SharedComponents/Cs am/SockAdapter/lib:/usr/lib:/opt/CA/UnicenterNSM/lib:/opt/CA/SharedCom ponents/ccs/dia/lib:/opt/CA/SharedComponents/ccs/dia/dna/lib:/opt/CA/S共享组件/JRE/1.7.0_25/lib/i386:/opt/CA/SharedComponents/JRE/1.7 .0_25/lib/i386/client PATH=/usr/local/git/bin/:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr /local/git/bin:/opt/CA/SharedComponents/bin:/opt/CA/SharedComponents/c cs/cam/bin:/opt/CA/SharedComponents/ccs/atech/services/bin:/opt/CA/SharedComponents/ccs/atech/agents/bin:/opt/CA/SharedComponents/ccs/bin:/opt/CA/SharedComponents/ccs/scripts:/opt/CA/SharedComponents/ccs/snmp/b在:/opt/CA/UnicenterNSM/nsmutils/bin:/opt/CA/UnicenterNSM/bin:/root/bi n REQUESTS_CA_BUNDLE=SSL_CERT_FILE=SUDO_COMMAND=/bin/bash SUDO_GID=13000 SUDO_UID=14272 SUDO_USER=pbibhu
active environment : None
user config file : /root/.condarc
填充的配置文件:conda 版本:4.6.14 conda-build 版本:3.17.6 python 版本:3.7.1.final.0 基本环境:/opt/cloudera/extras/anaconda3-2018(可写) 频道 URL:https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/linux-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch 包缓存:/opt/cloudera/extras/anaconda3-2018/pkgs /root/.conda/pkgs envs 目录:/opt/cloudera/extras/anaconda3-2018/envs /root/.conda/envs 平台:linux-64 用户代理:conda/4.6.14 请求/2.19.1 CPython/3.7.1 Linux/2.6.32-754.9.1.el6.x86_64 rhel/6.10 glibc/2.12 UID:GID:0:0 netrc 文件:无 离线模式:False 发生意外错误。 Conda 已准备好上述报告。 如果提交,核心维护人员将使用此报告来改进 conda 的未来版本。 您希望 conda 将此报告发送给核心维护人员吗? [y/N]:已超时。 未发送报告。
答案1
使用 Anaconda 离线安装软件包时,我遇到了几乎相同的问题。似乎是 PATH 变量被污染了。以下是我在 Ubuntu 16.04 上的解决方案:
- 首先,检查 ~/.bashrc 以确保您的 PATH 设置正确。
- 然后,执行:
$ PATH=$(getconf PATH)
重置 PATH 变量 - 现在,转到您的 anaconda3 文件夹(/opt/cloudera/extras/anaconda3-2018/bin)并执行:
$ ./conda init
这样 anaconda 就可以在您的 .bashrc 文件中修复其路径。 - 最后执行:
$ source ~/.bashrc