Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import error #122

Open
chaoyue729 opened this issue May 14, 2020 · 2 comments
Open

import error #122

chaoyue729 opened this issue May 14, 2020 · 2 comments

Comments

@chaoyue729
Copy link

use python3.7 and MacOS env

AttributeError Traceback (most recent call last)
in
----> 1 from localgraphclustering import *

~/anaconda3/lib/python3.7/site-packages/localgraphclustering/init.py in
----> 1 from .GraphLocal import GraphLocal
2 from .GraphDrawing import GraphDrawing
3 from .fiedler import fiedler, fiedler_local
4 from .approximate_PageRank import approximate_PageRank
5 from .approximate_PageRank_weighted import approximate_PageRank_weighted

~/anaconda3/lib/python3.7/site-packages/localgraphclustering/GraphLocal.py in
8 import warnings
9 import collections as cole
---> 10 from .cpp import *
11 import random
12

~/anaconda3/lib/python3.7/site-packages/localgraphclustering/cpp/init.py in
41 from .MQI_cpp import *
42 from .proxl1PRaccel import *
---> 43 from .proxl1PRrand_cpp import *
44 from .SimpleLocal_cpp import *
45 from .sweepcut_cpp import *

~/anaconda3/lib/python3.7/site-packages/localgraphclustering/cpp/proxl1PRrand_cpp.py in
50
51 _graphlib_funs_proxl1PRrand64 = _setup_proxl1PRrand_args(
---> 52 'int64','int64', _graphlib.proxl1PRrand64)
53 _graphlib_funs_proxl1PRrand32 = _setup_proxl1PRrand_args(
54 'uint32','uint32', _graphlib.proxl1PRrand32)

~/anaconda3/lib/python3.7/ctypes/init.py in getattr(self, name)
367 if name.startswith('') and name.endswith(''):
368 raise AttributeError(name)
--> 369 func = self.getitem(name)
370 setattr(self, name, func)
371 return func

~/anaconda3/lib/python3.7/ctypes/init.py in getitem(self, name_or_ordinal)
372
373 def getitem(self, name_or_ordinal):
--> 374 func = self._FuncPtr((name_or_ordinal, self))
375 if not isinstance(name_or_ordinal, int):
376 func.name = name_or_ordinal

@MengLiuPurdue
Copy link
Collaborator

Try to run this using Python 3.6. I didn't test it on python 3.7.

@dgleich
Copy link
Collaborator

dgleich commented May 23, 2020

This looks to me like the C++ library wasn't installed correctly because it's failing when gettin the function pointer. Make sure you compile it (bin/createGraphLibFile.sh) and then install. I verified that this does work with python 3.7 and macOS using the Home-brew python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants