googlecodelabs / android-perf-testing

Automated Performance Testing on Android
https://codelabs.developers.google.com/codelabs/android-perf-testing/
Apache License 2.0
93 stars 39 forks source link

systrace.py command throws error #24

Closed IgorGanapolsky closed 7 years ago

IgorGanapolsky commented 7 years ago

Hello, your codelab states to do the following command: python $ANDROID_HOME/platform-tools/systrace/systrace.py --time=10 -o ~/trace.html gfx view res

However, it causes this error:

Traceback (most recent call last): File "/Users/igorganapolsky/Library/Android/sdk/platform-tools/systrace/systrace.py", line 48, in from systrace import run_systrace File "/Users/igorganapolsky/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 43, in from systrace import systrace_runner File "/Users/igorganapolsky/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/systrace_runner.py", line 15, in from systrace.tracing_agents import battor_trace_agent File "/Users/igorganapolsky/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/battor_trace_agent.py", line 11, in from battor import battor_wrapper File "/Users/igorganapolsky/Library/Android/sdk/platform-tools/systrace/catapult/common/battor/battor/battor_wrapper.py", line 22, in import serial ImportError: No module named serial

IgorGanapolsky commented 7 years ago

I solved the problem: sudo pip2.7 install pyserial

ShanmugavelGK commented 7 years ago

I am also getting the same error. But, am using Windows system.What can I do?. Advance thanks.

IgorGanapolsky commented 7 years ago

@ShanmugavelGK Did you install the right python modules?

ShanmugavelGK commented 7 years ago

@IgorGanapolsky Yes. I have installed python 2.7

IgorGanapolsky commented 7 years ago

@ShanmugavelGK No. You need to install the required modules via pip. Read this to learn how to do it: https://docs.python.org/2/installing/

ShanmugavelGK commented 7 years ago

Thanks, Bro @IgorGanapolsky. I will try and let you know.

852172891 commented 3 years ago

my error

C:\Users\hhh\AppData\Local\Android\Sdk\platform-tools\systrace>python systrace.py --time=10 -o my_systrace.html
Traceback (most recent call last):
  File "systrace.py", line 48, in <module>
    from systrace import run_systrace
  File "C:\Users\hhh\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 43, in <module>
    from systrace import systrace_runner
  File "C:\Users\hhh\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\systrace_runner.py", line 11, in <module>
    from systrace import output_generator
  File "C:\Users\hhh\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\systrace\systrace\output_generator.py", line 15, in <module>
    from tracing.trace_data import trace_data
  File "C:\Users\hhh\AppData\Local\Android\Sdk\platform-tools\systrace\catapult\tracing\tracing\trace_data\trace_data.py", line 17, in <module>
    import six
ImportError: No module named six

I solved the problem: pip install six

summary find ImportError what, use pip install it