dutzi / tamper

Devtools extension, lets you locally edit files served from the web (based on mitmproxy).
http://dutzi.github.io/tamper
MIT License
394 stars 36 forks source link

pip install tamper fails on windows (pip install works otherwise) #10

Closed SgtPooki closed 10 years ago

SgtPooki commented 10 years ago

Chrome: Version 38.0.2125.101 m Windows OS: 8.1

pip.log:

c:\python\Scripts\pip3 run on 10/14/14 19:25:05 Downloading/unpacking tamper Getting page https://pypi.python.org/simple/tamper/ URLs to search for versions for tamper:

SyntaxError: invalid syntax


Cleaning up... Removing temporary dir C:\Users\RUSSEL~1\AppData\Local\Temp\pip_build_Russell Dempsey... Command python setup.py egg_info failed with error code 1 in C:\Users\RUSSEL~1\AppData\Local\Temp\pip_build_Russell Dempsey\tamper Exception information: Traceback (most recent call last): File "C:\python\lib\site-packages\pip\basecommand.py", line 122, in main status = self.run(options, args) File "C:\python\lib\site-packages\pip\commands\install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "C:\python\lib\site-packages\pip\req.py", line 1229, in prepare_files req_to_install.run_egg_info() File "C:\python\lib\site-packages\pip\req.py", line 325, in run_egg_info command_desc='python setup.py egg_info') File "C:\python\lib\site-packages\pip\util.py", line 697, in call_subprocess % (command_desc, proc.returncode, cwd)) pip.exceptions.InstallationError: Command python setup.py egg_info failed with error code 1 in C:\Users\RUSSEL~1\AppData\Local\Temp\pip_build_Russell Dempsey\tamper

Ncage1974 commented 10 years ago

Add me to the list of people getting this error. I'm using Windows 7 x64. After getting this error i checked to see if tamper was working in chrome (38 x64 version) and i get the following error in tamper "Could not connect to proxy".

dutzi commented 10 years ago

Howdy! Thanks for the report. What version of Python are you using?

grishanin commented 10 years ago

@Ncage1974 I have the same. @dutzi 2.7.8

Ncage1974 commented 10 years ago

Hi dutzi.

Python Verison: Python 3.4.2 PIP Version: pip 1.5.6 from C:\python\lib\site-packages (python 3.4)

Ridermansb commented 10 years ago

+1 .. error on Windows 8 x64


C:\Python34\Scripts\pip run on 10/17/14 10:59:51 Downloading/unpacking tamper Getting page https://pypi.python.org/simple/tamper/ URLs to search for versions for tamper:

SyntaxError: invalid syntax


Cleaning up... Removing temporary dir C:\Users\RIDERM~1\AppData\Local\Temp\pip_build_ridermanb... Command python setup.py egg_info failed with error code 1 in C:\Users\RIDERM~1\AppData\Local\Temp\pip_build_ridermanb\tamper Exception information: Traceback (most recent call last): File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main status = self.run(options, args) File "C:\Python34\lib\site-packages\pip\commands\install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "C:\Python34\lib\site-packages\pip\req.py", line 1229, in prepare_files req_to_install.run_egg_info() File "C:\Python34\lib\site-packages\pip\req.py", line 325, in run_egg_info command_desc='python setup.py egg_info') File "C:\Python34\lib\site-packages\pip\util.py", line 697, in call_subprocess % (command_desc, proc.returncode, cwd)) pip.exceptions.InstallationError: Command python setup.py egg_info failed with error code 1 in C:\Users\RIDERM~1\AppData\Local\Temp\pip_build_ridermanb\tamper

dutzi commented 10 years ago

@Ncage1974 and @Ridermansb, can you please try installing Tamper in Python 2.7x, I don't think it, or even Mitmproxy support Python 3x.

Ncage1974 commented 10 years ago

@dutzi thanks for the help. Using python2 it installs with no errors (oh ya i had to install Microsoft Visual C++ Compiler Package for Python 2.7 too) but unfortunately i'm still getting the error "Could not connect to web proxy" at the top of the tamper console in the developer tools.

I can only thing of two things. We have websense for internet access. Maybe websense is doing some blocking? Is it compatible with the x64 version of chrome?

dutzi commented 10 years ago

I never heard of this but Tamper is a pretty new project so I guess it could be...

Can you try and:

  1. Browse to chrome://extensions/
  2. Look for "Tamper"
  3. Click on "Background Page" (make sure "Developer Mode checkbox on the top-right corner is checked first)
  4. Go to the Console tab
  5. Click Ctrl/Cmd+R (this will reload the proxy)
  6. Copy and paste the log here? :)
luanvuvt commented 10 years ago

Hi @dutzi, I have tried the above solution but still failed. Please recheck this problem. Here is my console log:

connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected connecting to proxy Disconnected Port {sender: Object, disconnect: function, postMessage: function, name: (...), onDisconnect: (...)…} hye Sending message Object {method: "proxy-state-update", isProxyEnabled: false, proxyState: "proxy disconnected"} to port Port {sender: Object, disconnect: function, postMessage: function, name: (...), onDisconnect: (...)…} sending proxy state update false proxy disconnected connecting to proxy Disconnected Sending message Object {method: "proxy-state-update", isProxyEnabled: false, proxyState: "proxy disconnected"} to port Port {sender: Object, disconnect: function, postMessage: function, name: (...), onDisconnect: (...)…}

dutzi commented 10 years ago

Hi @luanvuvt, it looks like the extension can't get the proxy running. What is your OS, Chrome and Python version? Could you run $ pip freeze and paste the output here?

luanvuvt commented 10 years ago

Hi @dutzi, I'm using Windows 8.1, Chrome 37 and Python 2.7.4. Here is result after running pip freeze:

Flask==0.10.1 Jinja2==2.7.3 MarkupSafe==0.23 PyYAML==3.11 Werkzeug==0.9.6 backports.ssl-match-hostname==3.4.0.2 certifi==14.05.14 cffi==0.8.6 cov-core==1.14.0 coverage==3.7.1 coveralls==0.4.4 cryptography==0.6.1 docopt==0.6.2 gevent-websocket==0.9.3 itsdangerous==0.24 mitmproxy==0.11 mock==1.0.1 -e git+https://github.com/mitmproxy/netlib.git@29a4e9105053118aa8c0b458bcb8f10f0bc333d1#egg=netlib-master nose==1.3.4 nose-cov==1.6 passlib==1.6.2 -e git+https://github.com/mitmproxy/pathod.git@60e3e0b898861804a475fc0f0e860ad5ec51fe13#egg=pathod-master pyOpenSSL==0.14 pyasn1==0.1.7 pycparser==2.10 pydivert==0.0.6 requests==2.4.3 six==1.8.0 sortedcontainers==0.9.1 tamper==0.23 tornado==4.0.2 virtualenv==1.11.6

dutzi commented 10 years ago

Thanks @luanvuvt, @Ncage1974,

Everything looked ok so I thought it could be one of two things, either Tamper's python script can't run or the message passing (Chrome's feature that allows running and communicating with native apps) wasn't setup correctly.

I was going to ask you to search your registry for this key HKEY_CURRENT_USER\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.dutzi.tamper. This key's value should be C:\Users\luanvuvt\tamper-manifest.json.

But then I looked at the setup code and found this dumb bug. I hardcoded my home folder into setup.py :frowning:.

I'll release a fix for this soon, but for now you can just edit this registry key HKEY_CURRENT_USER\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.dutzi.tamper, change its value to C:\Users\<user>\tamper-manifest.json (replace <user> with your username).

luanvuvt commented 10 years ago

Hi @dutzi, I have tried the solution:

HKEY_CURRENT_USER\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.dutzi.tamper, change its value to C:\Users\tamper-manifest.json (replace with your username).

Now Tamper is working properly. Hope the next version of Tamper will be released soon. Thanks for your help.

dutzi commented 10 years ago

:+1:

dutzi commented 10 years ago

It's out in v0.24.1

luanvuvt commented 10 years ago

Thank you very much, @dutzi! :) I have updated Tamper to version 0.24.1. It works properly.

dutzi commented 10 years ago

Great!

arianitu commented 10 years ago

Proxy Error (100): Could not start proxy, port 8080 is in use

How do you change the port that tamper uses?

dutzi commented 10 years ago

Hi @arianitu, just click the cog icon (image), you can set the port there. Don't forget to restart the Proxy afterwards.

SgtPooki commented 10 years ago

Whoohoo! it's been a crazy few weeks for me but i'm glad to see that this has been fixed. I will have to confirm for myself another time. Awesome work everyone.

Nek commented 7 years ago

I have the same error including this loop: ''' connecting to proxy Disconnected ''' Tried to run tamper.py from command line and this gives me: ''' s {"msg": {"errorCode": 101, "errorDesc": "Could not start proxy, error loading libraries", "method": "proxy-error"}} '''

ailieff commented 7 years ago

Try removing pydivert and install 1.0.2. I had the same issue pip install pydivert==1.0.2

ailieff commented 7 years ago

btw, I'm having the same issue as luanvuvt. Cannot run Tamper. When I manually run temper.bat it runs OK.

Any ideas?