How to create a Conda environment that uses PyPy?

前端 未结 4 1765
夕颜
夕颜 2021-02-13 22:50

So here is my issue. I\'ve managed to install PyPy using conda with the following command:

conda install -c conda-forge pypy3.5

Unfortunately,

相关标签:
4条回答
  • 2021-02-13 23:16

    Worked for me like this:

    conda create -n pypy3 -c conda-forge pypy3.5
    

    Afterwards you have to link to the pypy3 interpreter within the bin directory of the env

    ln -s pypy3 python
    
    0 讨论(0)
  • 2021-02-13 23:20

    I'm not sure what changed, but conda install pypy3 definitely doesn't work for me (Jan-2021):

    conda install pypy3
    Collecting package metadata (current_repodata.json): done
    Solving environment: failed with initial frozen solve. Retrying with flexible solve.
    Collecting package metadata (repodata.json): done
    Solving environment: failed with initial frozen solve. Retrying with flexible solve.
    
    PackagesNotFoundError: The following packages are not available from current channels:
    
      - pypy3
    
    Current channels:
    
      - https://repo.anaconda.com/pkgs/main/win-64
      - https://repo.anaconda.com/pkgs/main/noarch
      - https://repo.anaconda.com/pkgs/r/win-64
      - https://repo.anaconda.com/pkgs/r/noarch
      - https://repo.anaconda.com/pkgs/msys2/win-64
      - https://repo.anaconda.com/pkgs/msys2/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.
    
    0 讨论(0)
  • 2021-02-13 23:28

    Might not achieve exactly what you want, but here's what i've done:

    Make a new conda env

    conda create --name pypy_env
    conda activate pypy_env
    

    Install pypy3 using conda

    conda install pypy3
    

    Get Pip for pypy3 using the method here Install pip on pypy

    Install packages for pypy using

    pypy3 -m pip install <name_of_package>
    

    For some packages it's eaiser to use the pre-built pypy wheel files, some you can find here https://www.lfd.uci.edu/~gohlke/pythonlibs/

    0 讨论(0)
  • 2021-02-13 23:29

    Conda now supports PyPy more smoothly.

    conda config --set channel_priority strict
    conda create -c conda-forge -n pypy pypy
    conda activate pypy
    

    There's still a lot of work being done to build conda packages for pypy, but there's already a lot of compatibility. For example,

    conda install mpmath
    conda install numpy
    

    both work now.

    Reference: https://conda-forge.org/blog/posts/2020-03-10-pypy

    Also note that the official recommendation for using pip with pypy is described here, the key point of which is this:

    Best practices with pip is to always call it as <python> -mpip ..., but if you wish to be able to call pip directly from the command line, you must call pypy -mensurepip --default-pip.

    0 讨论(0)
提交回复
热议问题