Issue with install with sudo
Created by: daubin427
Hello,
I did a fresh install on an Ubuntu 18.04.1 virtual machine. If I follow the steps in the readme all is fine to install. However when I run an example, I get this output:
- git clone https://github.com/Jacobe2169/GMatch4py.git
- cd to GMatch4py
- sudo python3 setup.py install
- All is well
I build a simple setup.py to test:
from distutils.core import setup from Cython.Build import cythonize
setup( ext_modules = cythonize("simpleGmatch4py.pyx") )
I create a simpleGmatch4py.pyx:
Gmatch4py use networkx graph
import networkx as nx
import the GED using the munkres algorithm
import gmatch4py as gm
g1=nx.complete_bipartite_graph(5,4) g2=nx.complete_bipartite_graph(6,4)
ged=gm.GraphEditDistance(1,1,1,1) # all edit costs are equal to 1 result=ged.compare([g1,g2],None) print(result) print("Done")
I build inplace: python3 setup.py build_ext --inplace
I then try to run it and get an error:
python3
import simpleGmatch4py Traceback (most recent call last): File "", line 1, in File "simpleGmatch4py.pyx", line 4, in init simpleGmatch4py import gmatch4py as gm File "/usr/local/lib/python3.6/dist-packages/gmatch4py/init.py", line 4, in from .ged.graph_edit_dist import * File "gmatch4py/ged/graph_edit_dist.pyx", line 1, in init GMatch4py.gmatch4py.ged.graph_edit_dist ModuleNotFoundError: No module named 'GMatch4py'
This error is similar to Issue #2 (closed). In Issue #2 (closed) the virtualenv method works perfectly.
Digging further, If I do the additional steps:
- pip3 install numpy networkx scikit-learn ipython cython scipy (Note no sudo here)
- python3 setup.py install (Note no sudo here) A. Errors installing in to /usr/local/lib/python3.6/dist-packages
- sudo chmod -R 777 /usr/local/lib/python3.6/dist-packages/gmatch4py
- python3 setup.py install (Note no sudo here)
- Rerun the test above and it works perfectly [[ 0. 14.] [10. 0.]] Done
While I do get it to work, it is not install/working as expected. I hope these details help.
Thank you again for your amazing work! :)