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

app-forensics/spiderfoot-3.3: ImportError: cannot import name 'nx' from 'networkx' #739

Closed
wofwofwof opened this issue Sep 4, 2021 · 3 comments

Comments

@wofwofwof
Copy link

When starting spiderfoot-3.3 I get

~% sf (12:08 04.09.21)(1) Traceback (most recent call last): File "/usr/share/spiderfoot/sf.py", line 27, in <module> import cherrypy_cors ModuleNotFoundError: No module named 'cherrypy_cors'
It seems cherrypy_cors is missing.

Thank you very much for your great work.

@wofwofwof wofwofwof changed the title app-forensics/spiderfoot-3.3: ImportError: cannot import name 'nx' from 'networkx' app-forensics/spiderfoot-3.3: <module> import cherrypy_cors ModuleNotFoundError: No module named 'cherrypy_cors' Sep 4, 2021
@blshkv blshkv closed this as completed in a564d91 Sep 4, 2021
@blshkv
Copy link
Contributor

blshkv commented Sep 4, 2021

thanks, I just pushed a fix, please check

@wofwofwof
Copy link
Author

wofwofwof commented Sep 4, 2021

Hello blshkv,
many thanks, the error is gone now, but a new one arises:

Traceback (most recent call last):
File "/usr/share/spiderfoot/sf.py", line 24, in
from sflib import SpiderFoot
File "/usr/share/spiderfoot/sflib.py", line 36, in
from networkx import nx
ImportError: cannot import name 'nx' from 'networkx' (/usr/lib/python3.9/site-packages/networkx/init.py)

For me that looks pretty strange, because if I do ls -l on /usr/lib/python3.9/site-packages/networkx/ I get:
total 176
34595202 drwxr-xr-x 12 root root 4096 Sep 3 22:11 ./
33267716 drwxr-xr-x 477 root root 32768 Sep 4 21:33 ../
34848922 drwxr-xr-x 21 root root 4096 Sep 3 22:11 algorithms/
34660355 drwxr-xr-x 4 root root 4096 Sep 3 22:11 classes/
33039082 -rw-r--r-- 1 root root 9443 Jul 8 14:57 conftest.py
33039083 -rw-r--r-- 1 root root 48304 May 31 22:28 convert_matrix.py
33039078 -rw-r--r-- 1 root root 15844 Jun 22 00:08 convert.py
34955636 drwxr-xr-x 4 root root 4096 Sep 3 22:11 drawing/
33039080 -rw-r--r-- 1 root root 3537 May 31 22:28 exception.py
34660467 drwxr-xr-x 4 root root 4096 Sep 3 22:11 generators/
33039079 -rw-r--r-- 1 root root 2906 Jul 27 04:11 init.py
34832752 drwxr-xr-x 4 root root 4096 Sep 3 22:11 linalg/
34660461 drwxr-xr-x 2 root root 4096 Sep 3 22:11 pycache/
34840961 drwxr-xr-x 5 root root 4096 Sep 3 22:11 readwrite/
33039081 -rw-r--r-- 1 root root 10006 May 31 22:28 relabel.py
34832769 drwxr-xr-x 4 root root 4096 Sep 3 22:11 testing/
34840948 drwxr-xr-x 3 root root 4096 Sep 3 22:11 tests/
34840928 drwxr-xr-x 4 root root 4096 Sep 3 22:11 utils/

% eix networkx 
[I] dev-python/networkx
     Available versions:  2.6.2^t {examples extras test xml yaml PYTHON_TARGETS="python3_8 python3_9 python3_10"}
     Installed versions:  2.6.2^t(10:10:53 PM 09/03/2021)(-examples -extras -test -xml -yaml PYTHON_TARGETS="python3_9 -python3_8 -python3_10")

If you prefere it I can open a new issue for this.
Thank you very much for your help.

@blshkv blshkv reopened this Sep 4, 2021
@blshkv
Copy link
Contributor

blshkv commented Sep 5, 2021

So here is the summary of the problem. Version 3.3 is calling from networkx import nx which was removed from the current networkx-2.6.2. The upstream fixed that problem in 3.4, but broke userhome support, see:
smicallef/spiderfoot#1176

So I dont feel like fixing any bugs for now because upstream is doing restructuring. We will come back to it after they are done. As for now, you are on your own ;-) You can try to fix 3.3 by forking and downgrading networkx, or adopt a patch for 3.4

@blshkv blshkv closed this as completed Sep 5, 2021
@blshkv blshkv changed the title app-forensics/spiderfoot-3.3: <module> import cherrypy_cors ModuleNotFoundError: No module named 'cherrypy_cors' app-forensics/spiderfoot-3.3: ImportError: cannot import name 'nx' from 'networkx' Sep 5, 2021
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

2 participants