如何在macOS中为Python 3安装mlpy

时间:2018-04-24 10:53:23

标签: python-3.x installation

我正在尝试为Python3安装mlpy(我需要使用它的动态时间扭曲算法的实现。)但我无法让它工作。

可以使用Python 2.7在同一台机器上安装相同的软件包,没有任何问题,因此我不认为这是与操作系统相关的问题。

非常欢迎任何帮助!!

func applicationWillEnterForeground(_ application: UIApplication) {
    if let storyboardID = getCurrentViewController()?.restorationIdentifier, 
           storyboardID == "myview") {
           //do sth
        }
    }

当然,我的机器上安装了Option Explicit Function metricMeasure(str As String) Dim n As Long, unit As String, nums() As Variant Static rgx As Object, cmat As Object 'with rgx as static, it only has to be created once; beneficial when filling a long column with this UDF If rgx Is Nothing Then Set rgx = CreateObject("VBScript.RegExp") End If metricMeasure = vbNullString With rgx .Global = True .MultiLine = False .Pattern = "[0-9]{1,4}m?[lL]t?r?" If .Test(str) Then Set cmat = .Execute(str) 'resize the nums array to accept the matches ReDim nums(cmat.Count - 1) 'get measurement unit unit = Replace(cmat.Item(0), Val(cmat.Item(0)), vbNullString, 1, vbTextCompare) 'populate the nums array with the matches For n = LBound(nums) To UBound(nums) nums(n) = Val(cmat.Item(n)) Next n 'convert the nums array to a subtotal with unit suffix metricMeasure = Application.Sum(nums) & unit End If End With End Function (带有macOS 10.12的iMac)

2 个答案:

答案 0 :(得分:0)

当我们没有安装python头文件时,很可能gcc失败了。你可以尝试:

sudo apt-get install python3-dev 

尝试安装python 3的头库,然后回复。

答案 1 :(得分:0)

通过运行解决

python3 setup.py build_ext --include-dirs=/usr/local/include/ --rpath=/usr/local/lib/

后跟python3 setup.py install