화웨이 모바일 라우터에 대한 흥미로운 기사를 찾았습니다. https://blog.hqcodeshop.fi/archives/259-Huawei-E5186-AJAX-API.html 두 번째 메모에서 rvl이라는 누군가가 필자의 스크립트를 제공하여 API로 자동 재부팅하도록했습니다.파이썬 - 화웨이 재부팅 스크립트
들여 쓰기를 직접 수정하려고했습니다. 결과는 다음과 같습니다 http://pastebin.com/KqF5RsS0 맞는지 확실하지 않습니다. 어떤 Python 버전을 사용해야하는지조차 모르겠습니다.
[[email protected] ~]$ python -m router-reboot-script.py
/usr/bin/python: Error while finding spec for 'router-reboot-script.py' (AttributeError: module 'router-reboot-script' has no attribute '__path__')
[email protected] ~> /usr/bin/python2 router-reboot-script.py
Traceback (most recent call last):
File "router-reboot-script.py", line 6, in <module>
import requests
ImportError: No module named requests
또는
내가 더 파이썬 능력이 없습니다. 누군가 그것을 어떻게 운영하는지 알아낼 수 있습니까?편집
[[email protected] ~]$ sudo pip install requests
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python3.5/site-packages
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[[email protected] ~]$ sudo pip install --upgrade pip
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 686kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Successfully uninstalled pip-8.1.2
Successfully installed pip-9.0.1
[[email protected] ~]$ sudo pip install requests
Requirement already satisfied: requests in /usr/lib/python3.5/site-packages
[[email protected] ~]$ python -m router-reboot-script.py
/usr/bin/python: Error while finding spec for 'router-reboot-script.py' (AttributeError: module 'router-reboot-script' has no attribute '__path__')
[[email protected] ~]$ python router-reboot-script.py
내가 사용해야 파이썬의 어떤 버전 및 매개 변수의 종류 (-m 같은)를 사용 하는가?
체크 아웃이 보인다. 'pip install requests'를 시도한 다음 다시 실행 해 보셨습니까? –
질문에 대한 답변과 함께 편집되었습니다. – sabbath