alibaba / macaca

Automation solution for multi-platform. 多端自动化解决方案
https://macacajs.github.io
MIT License
3.17k stars 419 forks source link

ImportError: No module named macaca #938

Closed JLewis1001 closed 5 years ago

JLewis1001 commented 5 years ago

执行官方demo出现下面问题:

➜ tests git:(master) ✗ python macaca-android-sample.test.py Traceback (most recent call last): File "macaca-android-sample.test.py", line 5, in from macaca import WebDriver ImportError: No module named macaca

➜ tests git:(master) ✗ macaca doctor

macaca-doctor version: 2.0.18

Node.js checklist:

node env: /usr/local/bin/node node version: v12.6.0

iOS checklist:

macOS version: 10.14.5 Xcode Command Line Tools is ready, version: 2354. xcodebuild version: 10.2.1 iproxy[usbmuxd] is installed at: /usr/local/bin/iproxy ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy

Android checklist:

JAVA version is 1.8 JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home ANDROID_HOME is set to /Users/lewis/Library/Android/sdk Platforms is set to /Users/lewis/Library/Android/sdk/platforms/android-9 ADB tool is set to /Users/lewis/Library/Android/sdk/platform-tools/adb gradle is installed, version: 4.6

Installed driver list:

android: 2.1.0 location: /usr/local/lib/node_modules/macaca-android

electron: 5.0.0 location: /usr/local/lib/node_modules/macaca-electron

ios: 2.0.35 location: /usr/local/lib/node_modules/macaca-ios

➜ tests git:(master) ✗ macaca server --verbose

port: 3456 was occupied, changed port: 3457 index.js:15:12 [master] pid:54871 webdriver server start with config: { port: 3457, verbose: true, always: true, ip: '10.129.30.53', host: 'LewisdeMacBook-Pro-4.local', loaded_time: '2019-07-23 20:25:38' } middlewares.js:17:10 [master] pid:54871 base middlewares attached router.js:132:10 [master] pid:54871 router set Macaca server started

➜ ~ python --version Python 2.7.10

➜ ~ python3 zsh: command not found: python3

macaca-bot commented 5 years ago

This is the translated issue:


ImportError: No module named macaca

The following problem occurs when executing the official demo:

➜ tests git:(master) ✗ python macaca-android-sample.test.py Traceback (most recent call last):   File "macaca-android-sample.test.py", line 5, in     From macaca import WebDriver ImportError: No module named macaca

➜ tests git:(master) ✗ macaca doctor

  Macaca-doctor version: 2.0.18

  Node.js checklist:

  Node env: /usr/local/bin/node   Node version: v12.6.0

  iOS checklist:

  macOS version: 10.14.5   Xcode Command Line Tools is ready, version: 2354.   Xcodebuild version: 10.2.1   Iproxy[usbmuxd] is installed at: /usr/local/bin/iproxy   Ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy

  Android checklist:

  JAVA version is 1.8   JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home   ANDROID_HOME is set to /Users/lewis/Library/Android/sdk   Platforms is set to /Users/lewis/Library/Android/sdk/platforms/android-9   ADB tool is set to /Users/lewis/Library/Android/sdk/platform-tools/adb   Gradle is installed, version: 4.6

  Installed driver list:

  Android: 2.1.0   Location: /usr/local/lib/node_modules/macaca-android

  Electron: 5.0.0   Location: /usr/local/lib/node_modules/macaca-electron

  Ios: 2.0.35   Location: /usr/local/lib/node_modules/macaca-ios

➜ tests git:(master) ✗ macaca server --verbose

port: 3456 was occupied, changed port: 3457 index.js:15:12 [master] pid:54871 webdriver server start with config:  {   Port: 3457,   Verbose: true,   Always: true,   Ip: '10.129.30.53',   Host: 'LewisdeMacBook-Pro-4.local',   Loaded_time: '2019-07-23 20:25:38' } middlewares.js:17:10 [master] pid:54871 base middlewares attached router.js:132:10 [master] pid:54871 router set Macaca server started

➜ ~ python --version Python 2.7.10

➜ ~ python3 Zsh: command not found: python3

JLewis1001 commented 5 years ago

网上查了半天,没有找到有关的解决方法,这是什么问题造成的啊?只安装了python2.7

macaca-bot commented 5 years ago

This is the translated issue comment: @JQLewis


I checked it online for a long time and didn't find a solution. What caused this problem? Only installed python2.7

paradite commented 5 years ago

CI 是正常的: https://travis-ci.org/macaca-sample/sample-python/jobs/367256636 检查看看是不是依赖安装的有问题?或者安装python3。 https://github.com/macaca-sample/sample-python#install

macaca-bot commented 5 years ago

This is the translated issue comment: @paradite


CI is normal: https://travis-ci.org/macaca-sample/sample-python/jobs/367256636 Check to see if there is a problem with the installation? Or install python3. Https://github.com/macaca-sample/sample-python#install

JLewis1001 commented 5 years ago

CI 是正常的: https://travis-ci.org/macaca-sample/sample-python/jobs/367256636 检查看看是不是依赖安装的有问题?或者安装python3。 https://github.com/macaca-sample/sample-python#install

这个问题放了一段时间没去弄,今天重新安装配置了python3,使用pycharm打开项目,根据pycharm的报错提示导入macaca和wd,在terminal里执行python3 tests/macaca-android-sample.test.py 运行成功,非常感谢!

macaca-bot commented 5 years ago

This is the translated issue comment: @JQLewis


CI is normal: https://travis-ci.org/macaca-sample/sample-python/jobs/367256636 Check to see if there is a problem with the installation? Or install python3. https://github.com/macaca-sample/sample-python#install

This problem has not been fixed for a while. I reinstalled and configured python3 today, opened the project with pycharm, imported macaca and wd according to pycharm's error prompt, and executed python3 tests/macaca-android-sample.test.py in the terminal. Thank you very much for running successfully!