Linux 安装 fastFM

使用 pip 安装会出现奇怪的问题,所以此处选择用源码安装

这是官方给的安装方法

$ sudo apt-get install python-dev libopenblas-dev

# Clone the repo including submodules (or clone + `git submodule update --init --recursive`)
$ git clone --recursive https://github.com/ibayer/fastFM.git

# Enter the root directory
$ cd fastFM

# Install Python dependencies (Cython>=0.22, numpy, pandas, scipy, scikit-learn)
$ pip install -r ./requirements.txt

# Compile the C extension.
$ make                      # build with default python version (python)
$ PYTHON=python3 make       # build with custom python version (python3)

# Install fastFM
$ pip install .

首先是
git clone --recursive https://github.com/ibayer/fastFM.git
慢得头皮发麻,试了很多次都不行,都是下载到一般就连不上了,最后突发奇想,在服务器上面克隆下来,并传到本地。

然后是在进行 make 的时候,会报错

Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail..

百度没找到解决方法,谷歌了一下,找到了这个 issue
https://github.com/xianyi/OpenBLAS/issues/2227

在这里插入图片描述

在原来的 make 命令后面加上 TARGET=NEHALEM,问题解决。

综上:

  1. 如果你有云服务器,在云服务器上 git clone 下来(网速稳定)
  2. 使用 make 时后面加上TARGET=NEHALEM

总结:

  • 比较奇怪的问题尽量谷歌,百度搜不到
  • 对于底层源码是 C 写的库,尽量使用源码安装
  • 下次 git clone 项目,可以在服务器进行克隆
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值