Following this post I created an environment for pypy2.7: conda create -c conda-forge -n pypy2.7 pypy2.7
. In the new environment I can now do
$ python -c "import sys; print(sys.executable)"
/usr/bin/python
and
$ pypy -c "import sys; print(sys.executable)"
/home/julian/miniconda2/envs/pypy2.7/bin/pypy
So there is no python
in the environment, therefore the system's python
gets used, but there is pypy
im the environment, which is exactly what we want. Obviously if I try to
$ pypy
Python 2.7.13 (0e7ea4fe15e82d5124e805e2e4a37cae1a402d4b, Dec 28 2017, 20:45:53)
[PyPy 5.10.0 with GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named numpy
it does not work.
According to the post mentioned earlier, I should now be able to conda install numpy
, however this will do:
conda install numpy
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.8.3
latest version: 4.10.1
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: /home/julian/miniconda2/envs/pypy2.7
added / updated specs:
- numpy
The following NEW packages will be INSTALLED:
ca-certificates conda-forge/linux-64::ca-certificates-2020.12.5-ha878542_0
certifi conda-forge/linux-64::certifi-2020.12.5-py39hf3d152e_1
ld_impl_linux-64 conda-forge/linux-64::ld_impl_linux-64-2.35.1-hea4e1c9_2
libblas conda-forge/linux-64::libblas-3.9.0-8_openblas
libcblas conda-forge/linux-64::libcblas-3.9.0-8_openblas
libffi conda-forge/linux-64::libffi-3.3-h58526e2_2
libgfortran-ng conda-forge/linux-64::libgfortran-ng-9.3.0-hff62375_19
libgfortran5 conda-forge/linux-64::libgfortran5-9.3.0-hff62375_19
liblapack conda-forge/linux-64::liblapack-3.9.0-8_openblas
libopenblas conda-forge/linux-64::libopenblas-0.3.12-pthreads_h4812303_1
libstdcxx-ng conda-forge/linux-64::libstdcxx-ng-9.3.0-h6de172a_19
ncurses conda-forge/linux-64::ncurses-6.2-h58526e2_4
numpy conda-forge/linux-64::numpy-1.20.2-py39hdbf815f_0
openssl conda-forge/linux-64::openssl-1.1.1k-h7f98852_0
pip conda-forge/noarch::pip-21.1.1-pyhd8ed1ab_0
python conda-forge/linux-64::python-3.9.2-hffdb5ce_0_cpython
python_abi conda-forge/linux-64::python_abi-3.9-1_cp39
readline conda-forge/linux-64::readline-8.1-h46c0cb4_0
setuptools conda-forge/linux-64::setuptools-49.6.0-py39hf3d152e_3
sqlite conda-forge/linux-64::sqlite-3.35.5-h74cdb3f_0
tk conda-forge/linux-64::tk-8.6.10-h21135ba_1
tzdata conda-forge/noarch::tzdata-2021a-he74cb21_0
wheel conda-forge/noarch::wheel-0.36.2-pyhd3deb0d_0
xz conda-forge/linux-64::xz-5.2.5-h516909a_1
Notice the python conda-forge/linux-64::python-3.9.2-hffdb5ce_0_cpython
, so instead of installing numpy to pypy, it installs a new python3.9.
And sure enough after the numpy installation I get
$ python -c "import sys; print(sys.executable)"
/home/julian/miniconda2/envs/pypy2.7/bin/python
and numpy is still not installed for pypy.
How do I get conda install
to work on pypy instead of python?
All of this is happening on the WSL (Ubuntu 18.04).