enemy-of-the-state icon indicating copy to clipboard operation
enemy-of-the-state copied to clipboard

No module named "collections"

Open leisipeisi opened this issue 5 years ago • 4 comments

Hi,

thanks for sharing your implementation! I just installed it and wanted to share my experience.

I used Ubuntu 16.04, openjdk-9-jre-headless and jython 2.5.3.

The only error I encountered was

No moduled named "collections"

The problem was that I overwrote the path to the jython libraries by copy-pasting the command from the README. So make sure to write something like export JYTHONPATH=JYTHONPATH:./lib/apache-mime4j-0.6.jar: [...].

I don't know if this repository is still maintained, but it would be great to add this information to the README :)

So far, everything else works for me.

leisipeisi avatar Mar 08 '19 14:03 leisipeisi

Thanks for sharing your solution! I finally got it to work.

However export JYTHONPATH=$JYTHONPATH:[...] did not work in my case. The following command worked in my case. It is the same as in the README with the addition of /usr/lib/site-python:/usr/share/jython/Lib:

export JYTHONPATH=/usr/lib/site-python:/usr/share/jython/Lib:./lib/apache-mime4j-0.6.jar:./lib/commons-codec-1.4.jar:./lib/commons-collections-3.2.1.jar:./lib/commons-io-1.4.jar:./lib/commons-lang-2.4.jar:./lib/commons-logging-1.1.1.jar:./lib/cssparser-0.9.5.jar:./lib/htmlunit-2.8.jar:./lib/htmlunit-core-js-2.8.jar:./lib/httpclient-4.0.1.jar:./lib/httpcore-4.0.1.jar:./lib/httpmime-4.0.1.jar:./lib/nekohtml-1.9.14.jar:./lib/sac-1.3.jar:./lib/serializer-2.7.1.jar:./lib/xalan-2.7.1.jar:./lib/xercesImpl-2.9.1.jar:./lib/xml-apis-1.3.04.jar

Hopefully the README will be updated :)

beecurlxray avatar Mar 11 '19 18:03 beecurlxray

Hi,

we just tried to get the system work on Ubuntu 18.04 using jython 2.7.1 but we are encountering the following error:

No module named gargoylesoftware

during the import of com.gargoylesoftware.htmlunit as htmlunit.

Has anybody already tired using enemy-of-the-state on Ubuntu 18.04 and has any suggestions on how to proceed? We would appreciate any suggestion!

anneborcherding avatar Nov 19 '19 10:11 anneborcherding

Hey guys,

Regarding the error "No module named gargoylesoftware", this error is due to python does not have the jython library path. You will need to manually add every file in the export JYTHONPATH=... into sys.path.

The temporary solution is to add this to the beginning of crawler2.py:

import os,sys
jarlibpath="/your/full/path/to/lib/"
ls= [os.path.join(jarlibpath, f) for f in os.listdir(jarlibpath) if os.path.isfile(os.path.join(jarlibpath, f))]
sys.path.extend(ls)

Hope that works (if you still need this). Thanks.

xigaoli avatar Jun 05 '21 21:06 xigaoli

Thank you for your reply!

anneborcherding avatar Jul 07 '21 06:07 anneborcherding