用pip install Appium-Python-Client这个命令安装python-client时会报错:
ERROR: Command errored out with exit status 1:
command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-tVjl6f/appium-python-client/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-tVjl6f/appium-python-client/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-yB4HxA
cwd: /private/tmp/pip-install-tVjl6f/appium-python-client/
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-tVjl6f/appium-python-client/setup.py", line 19, in <module>
from appium.common.helper import library_version
File "appium/common/helper.py", line 20
def extract_const_attributes(cls: type) -> Dict[str, Any]:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
刚好搜到了这个文档可以参考:https://github.com/palantir/python-language-server/issues/370
把命令改成:sudo pip install Appium-Python-Client发现还是报错,所以不是权限的问题。
按照参考链接又把命令改为:sudo pip3 install Appium-Python-Client ,这次ok了。