Sanqui / discard2

Discard2 is a high fidelity archival tool for the Discord chat platform
MIT License
37 stars 1 forks source link

Discard2 reader fails when Python 2 is default on system #2

Open TheTechRobo opened 2 years ago

TheTechRobo commented 2 years ago
~/discard2 git:master ❯❯❯ npm run --silent start -- reader -f raw-jsonl $JOB_DIRECTORY > $JOB_DIRECTORY/jsonl.jsonl
mitmproxy read stderr: Traceback (most recent call last):
  File "mitmproxy/read.py", line 9, in <module>
    from mitmproxy import io, http
ModuleNotFoundError: No module named 'mitmproxy'

/home/thetechrobo/discard2/node_modules/brotli/build/encode.js:3
1<process.argv.length?process.argv[1].replace(/\\/g,"/"):"unknown-program");b.arguments=process.argv.slice(2);"undefined"!==typeof module&&(module.exports=b);process.on("uncaughtException",function(a){if(!(a instanceof y))throw a;});b.inspect=function(){return"[Emscripten Module object]"}}else if(x)b.print||(b.print=print),"undefined"!=typeof printErr&&(b.printErr=printErr),b.read="undefined"!=typeof read?read:function(){throw"no read() available (jsc?)";},b.readBinary=function(a){if("function"===
                                                                                                                                                                                                                              ^

Error: mitmproxy read exited with code 1
    at ChildProcess.<anonymous> (/home/thetechrobo/discard2/src/reader/mitmproxy.ts:22:19)
    at ChildProcess.emit (node:events:394:28)
    at ChildProcess.emit (node:domain:475:12)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)

I've got mitmproxy installed via both pip (--user) and apt.

Sanqui commented 2 years ago

Please install the mitmproxy and brotli Python modules with pip install mitmproxy brotli (for reference, this is done automatically in the Docker/Podman container)

TheTechRobo commented 2 years ago

As I said, both are already installed.

I can access them through the python3 REPL.

Sanqui commented 2 years ago

Sorry, I missed that. Does your default python --version happen to be Python 2?

TheTechRobo commented 2 years ago

Oops, that's the problem. Sorry, my bad.

Sanqui commented 2 years ago

I'll keep this issue open because Discard2 should try and use Python 3 automatically.