import ctype error when used with --scripts SCRIPT option from mitmdump
See original GitHub issueSteps to reproduce the problem:
- install binary release
- run mitmdump -s test.py (with import ctypes)
Output:
Addon error: Traceback (most recent call last):
File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 149, in __init__
File "ctypes/__init__.py", line 347, in __init__
OSError: command_path: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "mitmproxy/addonmanager.py", line 67, in safecall
File "mitmproxy/addons/script.py", line 76, in tick
File "mitmproxy/addonmanager.py", line 177, in register
File "mitmproxy/command.py", line 134, in collect_commands
File "ctypes/__init__.py", line 417, in __getattr__
File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 151, in __init__
PyInstallerImportError: Failed to load dynlib/dll 'command_path'. Most probably this dynlib/dll was not found when the application was frozen.
System information
UBUNTU 16.04
Mitmproxy: 3.0.0.dev1136 (commit 15f525e) binary Python: 3.5.2 OpenSSL: OpenSSL 1.1.0g 2 Nov 2017 Platform: Linux-4.13.0-32-generic-x86_64-with-debian-stretch-sid
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Error while using external Python module in mitmproxy project
I want to use some external module in my custom addon. For instance I want to use module lxml to parse some traffic...
Read more >Add proxy for python - sono naturale
Edit the HTTP entry in the Proxy Learn how to use mitmproxy framework to build HTTP ... Python Scripting is configured using the...
Read more >Privacy International's data interception environment
You can now start mitmproxy using " mitmproxy_start.sh " on the desktop ... If you are getting errors in the logfile for mitmproxy...
Read more >ChangeLog - ftp
Fix an error in courier-imap's installation script that results in creation ... Add an option to highlight using middle click instead of pressing...
Read more >mimtproxy running python script: "XX Module not imported"
If you want to use Python packages that are not included in mitmproxy's own installation, you need to install mitmproxy via pip or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Homebrew has an
--enable-bar
option to force building from source rather than using a “bottled” binary. Any chance of supporting that in future?Instead, on MacOS High Sierra:
brew uninstall mitmproxy
pip3 install mitmproxy
I didn’t need
sudo
forpip3
because Python 2 and 3 are installed through Homebrew.BeautifulSoup module is now found again!
Same error here
macOS, install by brew
brew install mitmproxy
then run
mitmdump -p 8081 -s Save1.py
error:
in script Save1.py: No module named 'yaml'
Reason:
brew installed mitmproxy contained a self version python, located in
/usr/local/Cellar/mitmproxy/4.0.4_3/libexec/bin/python
when using
mitmdump -s some_python_script.py
, whilesome_python_script.py
contain some thirdparty libs, such as here’syaml
it can NOT found it, so report error:
No module named 'yaml'
Solution:
NOT using brew install mitmproxy:
brew uninstall mitmproxy
but change to your system’s Python:
pyenv global 3.8.0
's pip:
pip3 install mitmproxy
Note: can NOT use (system’s) python2(2.7.5) to install mitmproxy, it will fail: