mitmproxy-node icon indicating copy to clipboard operation
mitmproxy-node copied to clipboard

No module named 'websockets'

Open foreseaz opened this issue 3 years ago • 2 comments

Hi, I'm running the following test script

import MITMProxy from 'mitmproxy';

async function main() {
  const interceptPaths = [
    '/eval'
  ]
  const mitmProxy = await MITMProxy.default.Create(undefined, interceptPaths, false);
}

main();

Got error:

MITMProxy not running; starting up mitmproxy.
Loading script /Users/.../mitmproxy-test-local/node_modules/mitmproxy/scripts/proxy.py
in script /Users/.../mitmproxy-test-local/node_modules/mitmproxy/scripts/proxy.py: No module named 'websockets'

Under env:

  • node: v16.14.2
  • python: 3.10.6
  • Mitmproxy: 8.1.1
  • Platform: Mac M1, macOS-12.4-arm64-arm-64bit

I've been stuck for a whole day and it's the critical dependency for my project, could you please give some instructions on this issue?

foreseaz avatar Sep 25 '22 01:09 foreseaz

The example repo is here, and the error is in the README

foreseaz avatar Sep 25 '22 02:09 foreseaz

Resovled by venv, fix PR here https://github.com/nleak/mitmproxy-test-local/pull/1

foreseaz avatar Sep 25 '22 03:09 foreseaz