Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 不能';找不到程序:';pypy';在谷歌Colab上。解决方案还是替代方案?_Python_Python 3.x_Google Colaboratory_Jit_Pypy - Fatal编程技术网

Python 不能';找不到程序:';pypy';在谷歌Colab上。解决方案还是替代方案?

Python 不能';找不到程序:';pypy';在谷歌Colab上。解决方案还是替代方案?,python,python-3.x,google-colaboratory,jit,pypy,Python,Python 3.x,Google Colaboratory,Jit,Pypy,我在google colab笔记本上发现了这个错误。我是否需要安装一些东西,或者在colab中无法使用pypy?我尝试过这个简单的脚本: %%pypy print("hello") # Couldn't find program: 'pypy' 如果我运行%lsmagic,则输出如下,其中存在pypy Available line magics: %alias %alias_magic %autocall %automagic %autosave %bookmark %cat

我在google colab笔记本上发现了这个错误。我是否需要安装一些东西,或者在colab中无法使用pypy?我尝试过这个简单的脚本:

%%pypy
print("hello")

# Couldn't find program: 'pypy'
如果我运行
%lsmagic
,则输出如下,其中存在pypy

Available line magics:
%alias  %alias_magic  %autocall  %automagic  %autosave  %bookmark  %cat  %cd  %clear  %colors  %config  %connect_info  %cp  %debug  %dhist  %dirs  %doctest_mode  %ed  %edit  %env  %gui  %hist  %history  %killbgscripts  %ldir  %less  %lf  %lk  %ll  %load  %load_ext  %loadpy  %logoff  %logon  %logstart  %logstate  %logstop  %ls  %lsmagic  %lx  %macro  %magic  %man  %matplotlib  %mkdir  %more  %mv  %notebook  %page  %pastebin  %pdb  %pdef  %pdoc  %pfile  %pinfo  %pinfo2  %pip  %popd  %pprint  %precision  %profile  %prun  %psearch  %psource  %pushd  %pwd  %pycat  %pylab  %qtconsole  %quickref  %recall  %rehashx  %reload_ext  %rep  %rerun  %reset  %reset_selective  %rm  %rmdir  %run  %save  %sc  %set_env  %shell  %store  %sx  %system  %tb  %tensorflow_version  %time  %timeit  %unalias  %unload_ext  %who  %who_ls  %whos  %xdel  %xmode

Available cell magics:
%%!  %%HTML  %%SVG  %%bash  %%bigquery  %%capture  %%debug  %%file  %%html  %%javascript  %%js  %%latex  %%perl  %%prun  %%pypy  %%python  %%python2  %%python3  %%ruby  %%script  %%sh  %%shell  %%svg  %%sx  %%system  %%time  %%timeit  %%writefile

Automagic is ON, % prefix IS NOT needed for line magics.

最终会有其他选择吗?我已经尝试过numba,但由于主要需要它来预处理数据,我通常需要OBEJCT,这似乎使numba无法在nopython模式下编译。因此,我正在寻找更灵活的东西,比如pypy。

在Colab虚拟机上安装pypy后,您可以在Colab中使用它:

!apt-get install pypy
最终会有其他选择吗?我已经尝试过numba,但由于主要需要它来预处理数据,我通常需要OBEJCT,这似乎使numba无法在nopython模式下编译。所以我在寻找更灵活的东西,比如pypy。如果您试图执行一些密集的任务,Colab可能不是一个好的选择。
%%pypy
import sys
print(sys.executable)
# /usr/bin/pypy