【问题标题】:Adding Python 3.7 to Anaconda [duplicate]将 Python 3.7 添加到 Anaconda [重复]
【发布时间】:2021-06-10 21:40:55
【问题描述】:

我目前的 anaconda 只有 python 3.8 和 3.9。

python                         3.8.5 h05baefb_8_cpython  conda-forge         
python                         3.8.6 h12cc5a1_1_cpython  conda-forge         
python                         3.8.6 h12cc5a1_2_cpython  conda-forge         
python                         3.8.6 h12cc5a1_3_cpython  conda-forge         
python                         3.8.6 h12cc5a1_4_cpython  conda-forge         
python                         3.8.6 h12cc5a1_5_cpython  conda-forge         
python                         3.8.6 h3098bc4_0_cpython  conda-forge         
python                         3.8.8 h12cc5a1_0_cpython  conda-forge         
python                         3.9.0 h4b4120c_5_cpython  conda-forge         
python                         3.9.0 hd001b3a_0_cpython  conda-forge         
python                         3.9.0 hd001b3a_1_cpython  conda-forge         
python                         3.9.0 hd001b3a_2_cpython  conda-forge         
python                         3.9.0 hd001b3a_3_cpython  conda-forge         
python                         3.9.0 hf1b0709_4_cpython  conda-forge         
python                      3.9.1rc1 h4b4120c_0_cpython  conda-forge         
python                      3.9.1rc1 h4b4120c_1_cpython  conda-forge         
python                         3.9.1 h4b4120c_0_cpython  conda-forge         
python                         3.9.1 hcbd9b3a_1_cpython  conda-forge         
python                         3.9.1 hcbd9b3a_2_cpython  conda-forge         
python                         3.9.1 hcbd9b3a_3_cpython  conda-forge         
python                         3.9.1 hcbd9b3a_4_cpython  conda-forge         
python                         3.9.1 hcbd9b3a_5_cpython  conda-forge         
python                         3.9.2 hcbd9b3a_0_cpython  conda-forge

这是我输入conda search --full-name python时输出的内容

现在我想安装 tensorflowjs,但为此我需要 tensorflow,但 pip install tensorflow 给了我这个错误 ERROR: Could not find a version that satisfies the requirement tensorflow ERROR: No matching distribution found for tensorflow

我的虚拟环境中的 python 版本是 3.8.8,但我认为我需要使用较低版本,但是当尝试使用 conda install -c anaconda python=3.7 安装 python 3.7 时,它给了我这个


  - python=3.7

Current channels:

  - https://conda.anaconda.org/anaconda/osx-arm64
  - https://conda.anaconda.org/anaconda/noarch
  - https://repo.anaconda.com/pkgs/main/osx-arm64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-arm64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://conda.anaconda.org/conda-forge/osx-arm64
  - https://conda.anaconda.org/conda-forge/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.

我不知道如何在我的 conda 中获取 python 3.7,请帮助!

【问题讨论】:

    标签: python pip conda


    【解决方案1】:

    试试

    conda create -n "testenv" python=3.7 -c conda-forge
    

    这适用于我的 conda 版本 4.9.2

    关于信息,conda-forge 有时可以在 conda 受到限制时提供替代方案。

    【讨论】:

    • 感谢您的建议!我尝试了你所说的,遗憾的是它给了我完全相同的输出“PackagesNotFoundError:当前频道不提供以下软件包:”(与我的问题相同)。我也在 conda verison 4.9.2 所以不知道为什么这不起作用:(由于某种原因我的频道不允许我选择 python 3.7
    • 这可能是因为 conda-forge 未添加到您的频道。运行conda config --append channels conda-forge,然后重试该命令。
    • 刚试了一下,它说“警告:'conda-forge' 已经在'频道'列表中,移动到底部”,所以我想我已经有了它,再次运行你的线路,它给了我同样的问题。在您的 anaconda 导航器中,当您转到环境选项卡并创建新环境时,python 版本是否包括 3.7?我的只有 3.8 的选项,显然我什至无法安装 3.7。
    • 当我列出所有可用版本时,我之前也没有获得 3.7 版本。尝试通过在安装命令CONDA_RESTORE_FREE_CHANNEL=1 前面添加以下内容来恢复免费频道搜索...我假设您使用的是 *nix 系统。如果在 Windows 上我相信它是 SET CONDA_RESTORE_FREE_CHANNEL=1 然后重新运行安装命令。如果您只想在单个环境中尝试此操作,请尝试:conda config --env --set restore_free_channel true
    • 如果上面的方法也不行,请输出结果:conda config --show channels
    【解决方案2】:

    所以我解决了这个问题...我使用 https://nektony.com/mac-app-cleaner 从我的 mac 中完全删除了 Anaconda,我的频道完全坏了,但现在我可以使用以前的 Python 版本。另外,我认为它们被破坏的原因是因为我确实遵循了为 M1 Macs 安装 tensorflow fork 的教程,这可能已经破坏了一些东西。

    【讨论】:

      【解决方案3】:

      正如merv 在他的评论中指出的那样:

      OP 在 osx-arm64 平台上。只有 Python v3.8 和 v3.9 为此构建。

      当您在终端中输入 conda search python 时,您会看到 Conda-forge 频道仅支持 Python 版本直到 3.8.5。

      This article 展示了如何使用 miniconda 安装旧版本。你可以试试。

      【讨论】:

        猜你喜欢
        • 2018-04-06
        • 2019-06-29
        • 1970-01-01
        • 2019-05-27
        • 1970-01-01
        • 1970-01-01
        • 2021-02-27
        • 2020-09-01
        • 1970-01-01
        相关资源
        最近更新 更多