Trouble with installing test.fm on Ubuntu 12.04

Just noticed ERPnext, looks fantastic. I had Python+MySQL+Javascript on my Ubuntu 12.04. I thought it would be a small pc of cake for me to set it up. I’ve already changed Mysql to Miriadb. But I’m stuck here with test.fm.

$erp-next> python setup.py install
… (omitted) …
File “setup.py”, line 10, in
version=version,
LookupError: You must have test.fm >= 1.0.4 installed before (GitHub - grafos-ml/frappe: Recommendations Serving Engine using python)

So, I have to get test.fm installed. Then, rather sorry but PasteBin/Gist service is not available here due to some reason, I got this:
$test.fm-master> python setup.py install
Could not locate executable g77
Could not locate executable f77
Could not locate executable ifort
Could not locate executable ifc
Could not locate executable lf95
Could not locate executable pgf90
Could not locate executable pgf77
Could not locate executable f90
Found executable /usr/bin/f95
Could not locate executable fort
Could not locate executable efort
Could not locate executable efc
Found executable /usr/bin/gfortran
ATLAS version 3.8.4 built by buildd on Sat Sep 10 23:12:12 UTC 2011:
UNAME : Linux crested 2.6.24-29-server #1 SMP Wed Aug 10 15:58:57 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
INSTFLG : -1 0 -a 1
ARCHDEFS : -DATL_OS_Linux -DATL_ARCH_HAMMER -DATL_CPUMHZ=1993 -DATL_USE64BITS -DATL_GAS_x8664
F2CDEFS : -DAdd_ -DF77_INTEGER=int -DStringSunStyle
CACHEEDGE: 393216
F77 : gfortran, version GNU Fortran (Ubuntu/Linaro 4.6.1-9ubuntu2) 4.6.1
F77FLAGS : -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -Wa,–noexecstack -fPIC -m64
SMC : gcc, version gcc (Ubuntu/Linaro 4.6.1-9ubuntu2) 4.6.1
SMCFLAGS : -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -Wa,–noexecstack -fPIC -m64
SKC : gcc, version gcc (Ubuntu/Linaro 4.6.1-9ubuntu2) 4.6.1
SKCFLAGS : -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -Wa,–noexecstack -fPIC -m64
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing testfm.egg-info/PKG-INFO
writing top-level names to testfm.egg-info/top_level.txt
writing dependency_links to testfm.egg-info/dependency_links.txt
reading manifest file ‘testfm.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
warning: no files found matching ‘’ under directory ‘doc’
warning: no files found matching '
’ under directory ‘lib’
warning: no files found matching ‘’ under directory ‘data’
warning: no previously-included files matching '
’ found under directory ‘dist’
warning: no previously-included files matching ‘.py[co]’ found under directory '
writing manifest file ‘testfm.egg-info/SOURCES.txt’
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
cythoning src/testfm/evaluation/cutil/measures.pyx to src/testfm/evaluation/cutil/measures.c

Error compiling Cython file:


cdef int i
for i in range(list_size):
#printf(“>>>%f %f\n”, ranked_list[i], ranked_list[i+1])
if ranked_list[i*2] == 1.:
relevant += 1.
map_measure += (relevant / (i+1.))
^

src/testfm/evaluation/cutil/measures.pyx:48:41: Pythonic division not allowed without gil, consider using cython.cdivision(True)

Error compiling Cython file:


for i in range(list_size):
#printf(“>>>%f %f\n”, ranked_list[i], ranked_list[i+1])
if ranked_list[i*2] == 1.:
relevant += 1.
map_measure += (relevant / (i+1.))
return 0.0 if relevant == 0. else (map_measure/relevant)
^

src/testfm/evaluation/cutil/measures.pyx:49:54: Pythonic division not allowed without gil, consider using cython.cdivision(True)
building ‘testfm.evaluation.cutil.measures’ extension
C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC

compile options: ‘-I/usr/include/python2.7 -c’
gcc: src/testfm/evaluation/cutil/measures.c
src/testfm/evaluation/cutil/measures.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
src/testfm/evaluation/cutil/measures.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: Command “gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/testfm/evaluation/cutil/measures.c -o build/temp.linux-x86_64-2.7/src/testfm/evaluation/cutil/measures.o” failed with exit status 1

I think you are installing the wrong frappe. Should be:

Thanks rmehta. I have no idea there are different versions of frappe. But I followed the link “Install via Frappe Bench” on the same page.
Now I downloaded the zip file on this page.

$frappe-develop> python setup.py install
…(omitted)…
File “/usr/lib/python2.7/dist-packages/setuptools/sandbox.py”, line 32, in
{‘file’:setup_script, ‘name’:‘main’}
File “setup.py”, line 17, in
install_requires=install_requires
File “/tmp/easy_install-ef4DoH/MySQL-python-1.2.5/setup_posix.py”, line 43, in get_config
File “/tmp/easy_install-ef4DoH/MySQL-python-1.2.5/setup_posix.py”, line 25, in mysql_config
EnvironmentError: mysql_config not found

Pls help me with fixing this. This is important. Thanks.

I think you are installing a different frappe. Remove it from your python environment and clone frappe from GitHub.

strangely for one custom migration job I was doing, installing following fixed the error and I was able complete migration.

~/frappe/frappe-bench/env/pip install https://github.com/grafos-ml/test.fm/archive/v1.0.4.tar.gz

Not recommended, but for those who are stuck with weird migrations errors with no idea or other possible help.