【问题标题】:Anaconda - can't install package offline after downloading itAnaconda - 下载后无法离线安装包
【发布时间】:2019-10-10 15:11:55
【问题描述】:

我正在尝试在未连接到 Internet 的远程计算机(带有 GPU)上安装一些软件包。

(有些人建议我应该使用 Docker,我可能会这样做,但这是最后一次让它工作的机会)。

仅供参考:我正在关注instructions here

到目前为止我做了什么:

  1. 下载 Anaconda Anaconda3-2019.03-Linux-x86_64.sh 文件并安装到远程机器上
$ conda --version
conda 4.6.14

然后从here 下载所需的包并将其移动到远程机器上。

$ ls pkgs-for-anaconda/linux-64/*tensorflow*
pkgs-for-anaconda/linux-64/tensorflow-gpu-1.9.0-hf154084_0.tar.bz2
  1. 设置一个新通道,即本地文件系统上的文件路径。
$ conda config --prepend channels file:///home/billtubbs/pkgs-for-anaconda

从配置中摘录以确认此方法有效:

channels:
  - file:///home/billtubbs/pkgs-for-anaconda
  - defaults
  1. 安装包
    $ conda install pkgs-for-anaconda/linux-64/tensorflow-gpu-1.9.0-hf154084_0.tar.bz2
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
  1. 索引包
$ conda index pkgs-for-anaconda/
Subdir: noarch: 100%|████████████████████████████████████| 2/2 [00:00<00:00, 81.80it/s]
(base) [billtubbs@localhost ~]$ ch: 0it [00:00, ?it/s]s]05 [00:00<00:00, 750741.03it/s]

是不是在 noarch 而不是 linux-64 中查找的问题?

  1. 尝试安装包

当我使用以下内容创建具有所需包的新环境时:

$ conda create -n tf tensorflow-gpu

我明白了:

Collecting package metadata: done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - tensorflow-gpu -> _tflow_190_select==0.0.1=gpu
  - tensorflow-gpu -> tensorflow==1.9.0

Current channels:

  - file:///home/billtubbs/pkgs-for-anaconda/linux-64
  - file:///home/billtubbs/pkgs-for-anaconda/noarch
  - 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

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

我不明白的是它表明我的频道存在。它甚至似乎在寻找正确的版本(1.9.0)。但它说找不到。

为了确认,我做了以下操作:

$ conda search tensorflow-gpu==1.9.0
Loading channels: done
# Name                       Version           Build  Channel             
tensorflow-gpu                 1.9.0      hf154084_0  pkgs-for-anaconda   
tensorflow-gpu                 1.9.0      hf154084_0  pkgs/main 

有人知道我做错了什么吗?

更新:

这里是一些输出

$ conda list --show-channel-urls

...

sympy                     1.3                      py37_0    defaults
tblib                     1.3.2                    py37_0    defaults
tensorflow-gpu            1.9.0                hf154084_0    file:///home/billtubbs/pkgs-for-anaconda
terminado                 0.8.1                    py37_1    defaults
testpath                  0.4.2                    py37_0    defaults

【问题讨论】:

    标签: python command-line conda package-managers


    【解决方案1】:

    我会建议你卸载当前版本的 anaconda,当我下载最新版本的 anaconda 时,我遇到了一些问题,我记得我无法安装例如 tensorflow 或 matplotlib.. 使用 tensorflow 或 matplotlib 的最佳版本是拥有一个带有 python 3.6. 的 anaconda 尝试安装在 2017-05-26. 中发布的 Anaconda3-4.4.0-Windows-x86_64Anaconda3-4.4.0-Linux-x86_64.sh

    Anacoda versions

    然后在运行之前尝试安装 tensorflow、matplotlib、pandas、numpy

    conda update conda
    

    更新anaconda的一些包。 您将毫无问题地安装这些软件包/库,

    最好的问候。 PD:我也尝试安装 docker,但是我遇到的问题比使用 python 和 pip 更多,这就是为什么我认为 anaconda 是最好的解决方案。

    【讨论】:

    • 谢谢。我会试试这个。
    • 谢谢。不知道为什么 conda 使用 Python 3.7 安装 tensorflow。我猜你不能一直依赖包管理器来做出正确的决定......
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 2021-03-06
    • 1970-01-01
    • 2020-10-20
    • 1970-01-01
    • 2016-01-31
    • 1970-01-01
    相关资源
    最近更新 更多