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

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

Open
TheTechRobo opened this issue May 29, 2022 · 5 comments
Open

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

TheTechRobo opened this issue May 29, 2022 · 5 comments
Labels
bug Something isn't working compatibility good first issue Good for newcomers nice-to-have

Comments

@TheTechRobo
Copy link
Contributor

TheTechRobo commented May 29, 2022

~/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
Copy link
Owner

Sanqui commented May 29, 2022

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
Copy link
Contributor Author

TheTechRobo commented May 29, 2022

As I said, both are already installed.

I can access them through the python3 REPL.

@Sanqui
Copy link
Owner

Sanqui commented May 29, 2022

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

@TheTechRobo
Copy link
Contributor Author

TheTechRobo commented May 29, 2022

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

@TheTechRobo TheTechRobo closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2022
@Sanqui
Copy link
Owner

Sanqui commented May 29, 2022

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

@Sanqui Sanqui reopened this May 29, 2022
@Sanqui Sanqui changed the title Reading into JSONL fails Discard2 reader fails when Python 2 is default on system May 29, 2022
@Sanqui Sanqui added bug Something isn't working good first issue Good for newcomers nice-to-have compatibility labels Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility good first issue Good for newcomers nice-to-have
Projects
None yet
Development

No branches or pull requests

2 participants