我测试了一个python脚本,用Pushover发送任何想法。但我得到了错误"ImportError:没有模块名为pushover“
我安装的版本:
# pip install python-pushover
Collecting python-pushover
Using cached https://files.pythonhosted.org/packages/6f/3d/144a0137c749bd152c3ab7f4d3ce8fe1455168dab36c2fcd900d3fab16ad/python-pushover-0.4.tar.gz
Requirement already satisfied: requests>=1.0 in /usr/local/lib/python3.5/dist-packages (from python-pushover) (2.21.0)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.5/dist-packages (from requests>=1.0->python-pushover) (1.24.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.5/dist-packages (from requests>=1.0->python-pushover) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.5/dist-packages (from requests>=1.0->python-pushover) (2018.11.29)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.5/dist-packages (from requests>=1.0->python-pushover) (2.8)
Installing collected packages: python-pushover
Running setup.py install for python-pushover ... done
Successfully installed python-pushover-0.4
# python -V
Python 2.7.13
# python3 -V
Python 3.5.3圣经的作者:
#!/usr/bin/env python
import pushover我尝试过用pip(3)来安装,但没有成功。
发布于 2018-12-13 07:33:26
我今天确实遇到了这个错误。这是由于您的系统中存在不同版本的python。
如果模块是为py3安装的,则在运行脚本之前只为py2安装/usr/bin/python。
有关更多信息,请参考Installed module using pip, not found。
发布于 2018-12-13 06:58:09
就我而言,你应该:
卸载该软件包:
pip uninstall pushover并安装正确的软件包:
pip install python-pushover你的代码会正常工作的。
https://stackoverflow.com/questions/53756482
复制相似问题