cyang-kth / fmm

Fast map matching, an open source framework in C++
https://fmm-wiki.github.io/
Apache License 2.0
898 stars 215 forks source link

An issue regarding installation #113

Closed yumhe closed 4 years ago

yumhe commented 4 years ago

Dear Can,

Thank you very much for sharing this framework!

I have encountered an issue regarding installation of fmm. After completed the instruction steps, I got this error message when I tried to run the test code.

$ python fmm_test.py

Traceback (most recent call last): File "fmm_test.py", line 1, in from fmm import Network,NetworkGraph,STMATCH,STMATCHConfig File "/home/Neptun/fmm/build/python/fmm.py", line 17, in _fmm = swig_import_helper() File "/home/Neptun/fmm/build/python/fmm.py", line 16, in swig_import_helper return importlib.import_module('_fmm') File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module import(name) ImportError: No such file or directory

I have checked the python environment variable as written in Q&A, it should be correct. When I tried the example of jupyter notebook, it also showed that "No module named 'fmm'". Could you please let me know what might be the problem?

I would like to thank you in advance.

Best Regards, Yuman He

cyang-kth commented 4 years ago

@yumhe

It seems to be the same problem described in this issue #71.

The final suggestion is that adding both build to PATH variable and build/python to PYTHONPATH.

Make sure that when you run the following commands in your terminal.

echo $PATH;
echo $PYTHONPATH;

You should see this information in your output.

/home/Neptun/fmm/build
/home/Neptun/fmm/build/python
yumhe commented 4 years ago

Thank you for the prompt reply.

my output looks like this

Neptun@DESKTOP-CF0FB2F ~ $ echo $PATH; home/Neptun/fmm/build:/usr/local/bin:/usr/bin:/cygdrive/c/Program Files/Common Files/libhmsbeagle:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/WINDOWS/System32/OpenSSH:/cygdrive/d/Program Files/Java/jdk-12.0.1/bin:/cygdrive/d/apache-ant-1.10.6-bin/apache-ant-1.10.6/bin:/cygdrive/c/Program Files/Common Files/Autodesk Shared:/cygdrive/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/cygdrive/d/Program Files/MATLAB/R2019b/bin:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/Users/Neptun/Anaconda3:/cygdrive/c/Users/Neptun/Anaconda3/Library/mingw-w64/bin:/cygdrive/c/Users/Neptun/Anaconda3/Library/usr/bin:/cygdrive/c/Users/Neptun/Anaconda3/Library/bin:/cygdrive/c/Users/Neptun/Anaconda3/Scripts:/cygdrive/c/Users/Neptun/AppData/Local/Microsoft/WindowsApps:/cygdrive/c/Users/Neptun/AppData/Local/GitHubDesktop/bin

Neptun@DESKTOP-CF0FB2F ~ $ echo $PYTHONPATH; /home/Neptun/fmm/build/python:

Do you think if some other directories showed in PATH have an impact on this error?

Thank you for your help!

cyang-kth commented 4 years ago

The paths are fine. But it seems that you have multiple versions of python. You are building fmm using the python in cygwin but the python and jupyter you are using is in native windows platform.

You need to use the python in the cygwin environment.

You can check the python library version used to build the fmm

cmake ..
-- Found PythonLibs: /usr/lib/libpython2.7.dll.a (found suitable version "2.7.18", minimum required is "2.7") 
-- Python header found at /usr/include/python2.7
-- Python library found at /usr/lib/libpython2.7.dll.a
-- Using swig add library
-- Configuring done
-- Generating done

See this link https://github.com/cyang-kth/fmm/issues/107#issuecomment-684969707

You perhaps need to install jupyter notebook for Python in cgywin if you want to use notebook.

cyang-kth commented 4 years ago

This issue is closed because it is inactive.