"conda install" 没有安装到 pypy
"conda install" not installing to pypy
在 this post 之后,我为 pypy2.7 创建了一个环境:conda create -c conda-forge -n pypy2.7 pypy2.7
。在新环境下我现在可以做
$ python -c "import sys; print(sys.executable)"
/usr/bin/python
和
$ pypy -c "import sys; print(sys.executable)"
/home/julian/miniconda2/envs/pypy2.7/bin/pypy
所以环境中没有python
,因此使用了系统的python
,但是环境中有pypy
,这正是我们想要的。显然,如果我尝试
$ 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
它不起作用。
根据前面提到的post,我现在应该可以conda install numpy
,但是这样就可以了:
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
注意 python conda-forge/linux-64::python-3.9.2-hffdb5ce_0_cpython
,因此它不会安装 numpy 到 pypy,而是安装一个新的 python3.9.
安装 numpy 后果然得到了
$ python -c "import sys; print(sys.executable)"
/home/julian/miniconda2/envs/pypy2.7/bin/python
并且 numpy 还没有为 pypy 安装。
如何让 conda install
在 pypy 而不是 python 上工作?
所有这一切都发生在 WSL (Ubuntu 18.04) 上。
conda不支持pypy2.7
在 this post 之后,我为 pypy2.7 创建了一个环境:conda create -c conda-forge -n pypy2.7 pypy2.7
。在新环境下我现在可以做
$ python -c "import sys; print(sys.executable)"
/usr/bin/python
和
$ pypy -c "import sys; print(sys.executable)"
/home/julian/miniconda2/envs/pypy2.7/bin/pypy
所以环境中没有python
,因此使用了系统的python
,但是环境中有pypy
,这正是我们想要的。显然,如果我尝试
$ 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
它不起作用。
根据前面提到的post,我现在应该可以conda install numpy
,但是这样就可以了:
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
注意 python conda-forge/linux-64::python-3.9.2-hffdb5ce_0_cpython
,因此它不会安装 numpy 到 pypy,而是安装一个新的 python3.9.
安装 numpy 后果然得到了
$ python -c "import sys; print(sys.executable)"
/home/julian/miniconda2/envs/pypy2.7/bin/python
并且 numpy 还没有为 pypy 安装。
如何让 conda install
在 pypy 而不是 python 上工作?
所有这一切都发生在 WSL (Ubuntu 18.04) 上。
conda不支持pypy2.7