在Ubuntu上,对于新手来说,如何安装 PYPY3?

分享于 

3分钟阅读

ubuntu

  繁體

问题

我想在Ubuntu中安装pypy3。


bash: /usr/bin/pypy: No such file or directory




答案1

这是PyPy的可移植版本,下载文件后,到下载文件夹,打开终端窗口,并运行以下命令:


cd ~/Downloads


tar xf pypy3-2.1-beta-linux_x86_64-portable.tar.bz2


pypy3-2.1-beta-linux_x86_64-portable/bin/pypy



你会得到PyPy提示。


答案2

所有二进制版本都打包在tar.bz2zip文件中,解压缩它们到主目录中


wget -q -P /tmp 


 https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.10.1-linux64.tar.bz2 


sudo tar -x -C /opt -f /tmp/pypy3-v5.10.1-linux64.tar.bz2


rm /tmp/pypy3-v5.10.1-linux64.tar.bz2


sudo mv /opt/pypy3-v5.10.1-linux64 /opt/pypy3


sudo ln -s /opt/pypy3/bin/pypy3 /usr/local/bin/pypy3



然后,你可以像平常一样创建虚拟环境:


virtualenv -p pypy3 some_env




答案3

可以使用浏览器下载源代码归档文件>> pypy3- v6.0.0 -src.tar.bz2,>> pypy3- v6.0.0 -src.tar.bz2


wget https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-src.tar.bz2


tar -xjf pypy3-v6.0.0-src.tar.bz2


cd pypy3-v6.0.0-src



或者你可以从Mercurial存储库下载它,并切换到3.5分支:


hg clone https://bitbucket.org/pypy/pypy


cd pypy


hg update py3.5



PyPy建议使用PyPy 2构建它,因为它比使用CPython 2.7更快,确保PyPy 2已安装:


sudo apt-get install pypy



现在安装构建依赖项:


sudo apt-get install gcc make libffi-dev pkg-config zlib1g-dev libbz2-dev libsqlite3-dev libexpat1-dev libssl-dev libgdbm-dev tk-dev libgc-dev python-cffi liblzma-dev libncursesw5-dev




cd pypy/goal # pypy3-v6.0.0-src/pypy/goal


pypy ../../rpython/bin/rpython -Ojit targetpypystandalone




cd ../tool/release # pypy3-v6.0.0-src/pypy/tool/release


pypy package.py --archive-name pypy3-v6.0.0



这将在下面创建准备的目录结构/tmp/usession-release-pypy3.5-v6.0.0-0 将它复制到/opt,并将可执行文件符号链接至/usr/local/bin


sudo mv /tmp/usession-release-pypy3.5-v6.0.0-0/build/pypy3-v6.0.0 /opt


sudo ln -s /opt/pypy3-v6.0.0/bin/pypy3 /usr/local/bin



现在,你可以使用以下命令运行PyPy 3:

 
pypy3





Ubuntu  pyp  PYPY  
相关文章