数学之路-python计算实战(1)-ubuntu安装pypy

  1. Get the source code. The following packages contain the source at the same revision as the above binaries:

    Or you can checkout the current trunk using Mercurial (the trunk usually works and is of course more up-to-date):

    hg clone https://bitbucket.org/pypy/pypy
    
  2. Make sure you installed the dependencies. See the list here.
  3. Enter the goal directory:
    cd pypy/pypy/goal
    
  4. Run the rpython script. Here are the common combinations of options (works also with pythoninstead of pypy):

    pypy ../../rpython/bin/rpython -Ojit targetpypystandalone           # get the JIT version
    pypy ../../rpython/bin/rpython -O2 targetpypystandalone             # get the no-jit version
    pypy ../../rpython/bin/rpython -O2 --sandbox targetpypystandalone   # get the sandbox versio

最好是从源码编译安装,否则麻烦很多其它,然后可能安装过程中会提示少一些库,依据提示在ubuntu中补充安装这些库就可以。主要有下面库:

sudo apt-get install zlib1g-dev

sudo apt-get install libssl-dev

sudo apt-get install libncurses5-dev

sudo apt-get install libexpat1-dev

sudo apt-get install libbz2-dev

时间: 2024-07-29 06:31:14

数学之路-python计算实战(1)-ubuntu安装pypy的相关文章

数学之路-python计算实战(18)-机器视觉-滤波去噪(双边滤波与高斯滤波 )

高斯滤波就是对整幅图像进行加权平均的过程,每一个像素点的值,都由其本身和邻域内的其他像素值经过加权平均后得到.高斯滤波的具体操作是:用一个模板(或称卷积.掩模)扫描图像中的每一个像素,用模板确定的邻域内像素的加权平均灰度值去替代模板中心像素点的值. #滤波去噪 lbimg=cv2.GaussianBlur(newimg,(3,3),1.8) cv2.imshow('src',newimg) cv2.imshow('dst',lbimg) cv2.waitKey() cv2.destroyAllW

数学之路-python计算实战(16)-机器视觉-滤波去噪(邻域平均法滤波)

# -*- coding: utf-8 -*- #code:[email protected] #邻域平均法滤波,半径为2 import cv2 import numpy as np fn="test3.jpg" myimg=cv2.imread(fn) img=cv2.cvtColor(myimg,cv2.COLOR_BGR2GRAY) #加上椒盐噪声 param=20 #灰阶范围 w=img.shape[1] h=img.shape[0] newimg=np.array(img)

数学之路-python计算实战(21)-机器视觉-拉普拉斯线性滤波

拉普拉斯线性滤波,.边缘检测   Laplacian Calculates the Laplacian of an image. C++: void Laplacian(InputArray src, OutputArray dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=BORDER_DEFAULT ) Python: cv2.Laplacian(src, ddepth[, dst[, k

数学之路-python计算实战(22)-机器视觉-sobel非线性滤波

sobel非线性滤波,采用梯度模的近似方式 Sobel Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator. C++: void Sobel(InputArray src, OutputArray dst, int ddepth, int dx, int dy, intksize=3, double scale=1, double delta=0, int

数学之路-python计算实战(11)-机器视觉-图像增强

在计算机领域中,灰度(Gray scale)数字图像是每个像素只有一个采样颜色的图像.这类图像通常显示为从最暗黑色到最亮的白色的灰度,尽管理论上这个采样可以任何颜色的不同深浅,甚至可以是不同亮度上的不同颜色.灰度图像与黑白图像不同,在计算机图像领域中黑白图像只有黑白两种颜色,灰度图像在黑色与白色之间还有许多级的颜色深度.用于显示的灰度图像通常用每个采样像素8 bits的非线性尺度来保存,这样可以有256种灰度(8bits就是2的8次方=256).这种精度刚刚能够避免可见的条带失真,并且非常易于编

数学之路-python计算实战(4)-Lempel-Ziv压缩(2)

Format characters have the following meaning; the conversion between C and Python values should be obvious given their types. The 'Standard size' column refers to the size of the packed value in bytes when using standard size; that is, when the forma

数学之路-python计算实战(3)-霍纳法则

假设有n+2个实数a0,a1,-,an,和x的序列,要对多项式Pn(x)= anx ^n+a(n-1)x^(n-1)+-+a1x+a0求值,直接方法是对每一项分别求值,并把每一项求的值累加起来,这种方法十分低效,它需要进行n+(n-1)+-+1=n(n+1)/2次乘法运算和n次加法运算.有没有更高效的算法呢?答案是肯定的.通过如下变换我们可以得到一种快得多的算法,即Pn(x)= anx ^n+a(n-1)x^(n-1)+-+a1x+a0=((-(((anx +an-1)x+an-2)x+ an-

数学之路-python计算实战(19)-机器视觉-卷积滤波

filter2D Convolves an image with the kernel. C++: void filter2D(InputArray src, OutputArray dst, int ddepth, InputArraykernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT ) Python: cv2.filter2D(src, ddepth, kernel[, dst[,

数学之路-python计算实战(20)-机器视觉-拉普拉斯算子卷积滤波

拉普拉斯算子进行二维卷积计算,线性锐化滤波 # -*- coding: utf-8 -*- #线性锐化滤波-拉普拉斯算子进行二维卷积计算 #code:[email protected] import cv2 import numpy as np from scipy import signal fn="test6.jpg" myimg=cv2.imread(fn) img=cv2.cvtColor(myimg,cv2.COLOR_BGR2GRAY) srcimg=np.array(im