Setting Up Appium with Python Environment
Dependencies
- Node.js
- Appium
- Appium Inspector
- Appium-Python-Client
- Python
- JDK (Java Development Kit)
- Android SDK
JDK Installation & Configuration
Download
Get JDK from:
Oracle JDK 8 Downloads
Configuration
Follow the guide to set up environment variables:
JDK Environment Variable Setup
Verify Installation
After setup, open Command Prompt and run:
C:\Users\TestUser>java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
Android SDK Installation
Download
Get the Android SDK from:
Android SDK Download
Configuration
Set the ANDROID_HOME environment variable after installation. Reference:
Android SDK Environment Setup
Node.js Installation
Download
Download Node.js from:
Node.js Releases
Note: Ensure Node.js version compatibility with Appium.
Verify Installation
Open Command Prompt (Win+R → cmd), run:
C:\Users\TestUser>node -v
v14.17.0
C:\Users\TestUser>npm -v
6.14.13
Notes:
npm(Node Package Manager) manages Node.js packages (similar to Python’spip).- If
npmis not recognized, run Command Prompt as Administrator or check environment variables.
Appium Installation
Using Taobao NPM Mirror (cnpm)
To avoid slow installation, use Taobao’s NPM mirror:
npm install -g cnpm --registry=https://registry.npm.taobao.org
After running, you should see output like:
C:\Users\TestUser>npm install -g cnpm --registry=https://registry.npm.taobao.org
npm WARN deprecated socks@1.1.11: ... (updated warning)
C:\Users\TestUser\AppData\Roaming\npm\cnpm -> ...\cnpm\bin\cnpm
+ cnpm@6.1.0
added 800+ packages in 70.123s
Install Appium
Latest Version:
cnpm install -g appium
Specific Version (e.g., 1.7.3):
cnpm install appium@1.7.3 -g
Upon completion, output similar to this appears:
All packages installed (570 packages, 58s, speed 850kB/s, ...)
[appium@1.8.1] link ...\appium@ -> ...\appium\build\lib\main.js
Install Driver
appium driver install uiautomator2
Verify Appium Installation
Check the installation path:
C:\Users\TestUser>where appium
C:\Users\TestUser\AppData\Roaming\npm\appium
C:\Users\TestUser\AppData\Roaming\npm\appium.cmd
Start Appium Server:
C:\Users\TestUser>appium -v
1.7.3
C:\Users\TestUser>appium
[Appium] Welcome to Appium v1.7.3
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
If
appiumis not recognized, add the installation path (e.g.,C:\Users\TestUser\AppData\Roaming\npm) to thePathenvironment variable.
Python & Appium-Python-Client
Python Installation
Ensure Python is installed (verify with python --version):
C:\Users\TestUser>python --version
Python 3.8.5
Install Appium-Python-Client
Run:
pip install Appium-Python-Client
Verify Installation
In Python shell:
C:\Users\TestUser>python
Python 3.8.5 ...
>>> from appium import webdriver
If no errors, the client is installed.
Appium-Doctor (Environment Check)
Install to verify dependencies:
cnpm install appium-doctor -g
Run the check:
C:\Users\TestUser>appium-doctor
info AppiumDoctor ...
info AppiumDoctor ✔ Node.js binary found
info AppiumDoctor ✔ ANDROID_HOME set
info AppiumDoctor ✔ JAVA_HOME set
...
info AppiumDoctor Everything looks good!