python - 在同一个conda环境中安装Python3.9和PyPy3.7

标签 python conda pypy

我在 mac os 10.13.6 上安装了 miniconda,并且想在已安装 Python3.9 的同一 conda 环境中安装 PyPy3.7。 但是,当我尝试安装 PyPy 时,出现以下依赖项错误。

(my_conda_env)$ conda install -c conda-forge pypy3.7
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: - 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                             

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package ncurses conflicts for:
python=3.9 -> readline[version='>=8.0,<9.0a0'] -> ncurses[version='>=6.1,<6.3.0a0|>=6.1,<7.0a0']
python=3.9 -> ncurses[version='>=6.2,<6.3.0a0|>=6.2,<7.0a0']

Package openssl conflicts for:
python=3.9 -> openssl[version='>=1.1.1h,<1.1.2a|>=1.1.1i,<1.1.2a|>=1.1.1j,<1.1.2a|>=1.1.1k,<1.1.2a']
pypy3.7 -> openssl[version='>=1.1.1i,<1.1.2a|>=1.1.1k,<1.1.2a']

Package libcxx conflicts for:
python=3.9 -> libcxx[version='>=10.0.0|>=10.0.1|>=11.0.0|>=11.0.1']
python=3.9 -> libffi[version='>=3.3,<3.4.0a0'] -> libcxx[version='>=4.0.1|>=9.0.1']

这很奇怪,因为三个冲突中的两个似乎是由于 python3.9 与自身冲突造成的。 此外,从下面的信息可以看出,安装的openssl、ncurses和libcxx版本应该满足上述所有约束。 有什么帮助吗?

(my_conda_env)$ conda list
# packages in environment at /Users/Sirion/miniconda3/envs/ro:
#
# Name                    Version                   Build  Channel
...
libcxx                    11.1.0               habf9029_0    conda-forge
libffi                    3.3                  h046ec9c_2    conda-forge
...
ncurses                   6.2                  h2e338ed_4    conda-forge
...
openssl                   1.1.1k               h0d85af4_0    conda-forge
...
python                    3.9.4           h9133fd0_0_cpython    conda-forge
python_abi                3.9                      1_cp39    conda-forge
readline                  8.1                  h05e3726_0    conda-forge
...

(my_conda_env)$ conda info

     active environment : my_conda_env
    active env location : -- OMISSIS --
            shell level : 2
       user config file : -- OMISSIS --
 populated config files : -- OMISSIS --
          conda version : 4.10.1
    conda-build version : not installed
         python version : 3.8.0.final.0
       virtual packages : __osx=10.13.6=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : -- OMISSIS --  (writable)
      conda av data dir : -- OMISSIS --
  conda av metadata url : https://repo.anaconda.com/pkgs/main
           channel URLs : http://conda.anaconda.org/gurobi/osx-64
                          http://conda.anaconda.org/gurobi/noarch
                          https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : -- OMISSIS --
                          -- OMISSIS --
       envs directories : -- OMISSIS --
                          -- OMISSIS --
               platform : osx-64
             user-agent : conda/4.10.1 requests/2.25.1 CPython/3.8.0 Darwin/17.7.0 OSX/10.13.6
                UID:GID : 501:20
             netrc file : None
           offline mode : False

最佳答案

不可能。Conda 的冲突报告不可靠。使用 mamba 运行可以清楚地看出 pypy3.7 具有 python=3.7 约束,即无法在以下环境中共同安装 Python 3.9:相同的环境。

曼巴输出

$ mamba create -n foo python=3.9 pypy3.7

                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██╔████╔██║███████║██╔████╔██║██████╔╝███████║
        ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝

        mamba (0.11.1) supported by @QuantStack

        GitHub:  https://github.com/mamba-org/mamba
        Twitter: https://twitter.com/QuantStack

█████████████████████████████████████████████████████████████


Looking for: ['python=3.9', 'pypy3.7']

bioconda/osx-64          [====================] (00m:01s) Done
bioconda/noarch          [====================] (00m:01s) Done
pkgs/r/noarch            [====================] (00m:00s) No change
pkgs/r/osx-64            [====================] (00m:00s) No change
pkgs/main/osx-64         [====================] (00m:01s) Done
pkgs/main/noarch         [====================] (00m:00s) Done
conda-forge/noarch       [====================] (00m:01s) Done
conda-forge/osx-64       [====================] (00m:04s) Done

Encountered problems while solving:
  - package pypy3.7-7.3.3-hb2afd79_3 has constraint python 3.7.* *_73_pypy conflicting with python-3.9.0-h88f2d9e_1

关于python - 在同一个conda环境中安装Python3.9和PyPy3.7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67570535/

相关文章:

python - 无法激活 Conda 环境,因为 'chcp' 和 'cmd' 未被识别为内部或外部命令可运行程序

python - 强制 conda 环境中的 rpy2 使用 conda 环境之外的 R

parsing - 我可以使用什么前端与 RPython 来实现语言?

Python:数据传输对象

python - Django django.db.utils.ProgrammingError。关系 <<Pages_account>> 不存在

python - 删除出现次数超过 N 次的重复值

rust - 无法从 conda 环境中的 jupyter 服务器连接到 rust 内核

python - 为什么elasticsearch在pypy上引发elasticsearch_dsl.exceptions.ValidationException : You cannot write to a wildcard index.而不是在cpython上?

Python:处理平均时间,第一个/第二个慢得多

python - 导入错误 : No module named pxssh