草庐IT

python - 如何解决 ImportError : No module named 'dbus' ?

我在我的ubuntu上安装了anaconda4,我的Python上有这些模块:dbus-python(1.2.4)gi(1.2)pydbus(0.2)QtAwesome(0.3.2)qtconsole(4.2.0)QtPy(1.0)sip(4.18)我尝试安装dbus-python(1.2.4)和pydbus(0.2),但是,它们都不起作用!在python3.5.1中测试一个简单的程序后,出现错误:importdbussystem_bus=dbus.SystemBus()ImportError:Nomodulenamed'dbus'当我在Python2.7.11和3.5.1中使用pyd

python - 属性错误 : 'unicode' object has no attribute 'values' when parsing JSON dictionary values

我有以下JSON字典:{u'period':16,u'formationName':u'442',u'formationId':2,u'formationSlots':[1,2,3,4,5,6,7,8,9,10,11,0,0,0,0,0,0,0],u'jerseyNumbers':[1,20,3,15,17,5,19,6,18,25,10,2,4,12,16,22,24,34],u'playerIds':[23122,38772,24148,39935,29798,75177,3860,8505,26013,3807,34693,18181,4145,23446,8327,107395

python - gevent 库 : "Import Error: no module named greenlet"

大家好,我下载了一个需要geventpython库的脚本,每次运行该脚本时,它都会显示:File"shodan.py",line7,infromgeventimportmonkeyFile"C:\Python27\lib\site-packages\gevent\__init__.py",line48,infromgevent.greenletimportGreenlet,joinall,killallFile"C:\Python27\lib\site-packages\gevent\greenlet.py",line6,infromgevent.hubimportgreenlet,g

python - Py 安装程序 "ImportError: No module named Pyinstaller"

这是我运行pythonconfigure.py时生成的代码。dan@Q430-Q530:~/pyinstaller-2.0/PyInstaller$pythonconfigure.pyTraceback(mostrecentcalllast):File"configure.py",line28,infromPyInstallerimportHOMEPATH,PLATFORMImportError:NomodulenamedPyInstaller因此,目前,由于缺少一个名为...PyInstaller的模块,我什至无法运行PyInstaller。这是PyInstaller2.0,您可以找

python - 安装rpy2时遇到错误: Tried to guess R's HOME but no R command in the PATH

我在这里和其他地方看到了很多关于此错误的帖子,但所提议的解决方案似乎都不相关。我在Python2.7.9,我有anRexecutableinmypath,我正在尝试将它安装在RHEL服务器上,而不是在Windows上。这是我看到的具体错误。有谁知道是什么原因造成的或如何解决?谢谢!$pipinstallrpy2Downloading/unpackingrpy2Downloadingrpy2-2.5.6.tar.gz(165kB):165kBdownloadedRunningsetup.py(path:/tmp/pip_build_my520/rpy2/setup.py)egg_info

python - 尝试在 Python 中使用 GSM 调制解调器调用电话时收到 "NO CARRIER"错误

我想使用我的GSM调制解调器调用电话。所以我写了下面的程序:importtimeimportserialrecipient="+98xxxxxxxxxx"phone=serial.Serial("COM10",115200,timeout=5)try:time.sleep(0.5)phone.write(b'ATZ\r')time.sleep(1)phone.write(b'ATD"'+recipient.encode()+b'"\r')while(1):print(phone.readline())time.sleep(0.5)finally:phone.close()但是当我运行它

python - 导入错误 : No module named enum on python 2. 7

我正在使用Python2.7运行代码。我得到“ImportError:没有名为enum的模块”。我用“pipinstallenum”安装了枚举,但错误不断出现。我该怎么办?? 最佳答案 你想要backport:pipinstallenum34不幸的是,PyPI上名为enum的发行版是另外一回事。 关于python-导入错误:Nomodulenamedenumonpython2.7,我们在StackOverflow上找到一个类似的问题: https://stac

python - 类型错误 : split() takes no keyword arguments in Python 2. x

我试图将文档的一部分分成不同的部分,这些部分由&符号分隔。这是我的:name,function,range,w,h,k,frac,constraint=str.split(str="&",num=8)错误:TypeError:split()takesnokeywordarguments有人可以向我解释错误并提供替代方法让我完成这项工作吗? 最佳答案 str.split的参数分别称为sep和maxsplit:str.split(sep="&",maxsplit=8)但是你只能在Python3.x中使用这样的参数名称。在Python2.

python - zc.buildout 停止工作 : ImportError: No module named apport. fileutils

我已经使用buildout很长一段时间了,没有任何问题,事实上我昨天没有遇到任何问题。但就像今天一样,我所有的项目都未能扩建。我在两个不同的Ubuntu工作站上尝试了相同的结果。这是我得到的错误:Initializingzc.buildoutDebug:Downloadinghttp://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.eggTraceback(mostrecentcalllast):File"bootstrap.py",line259,inimportzc.buildout.build

python - 导入错误 : No module named pxssh

我正在尝试使用pxssh模块与客户端建立SSH连接-但是我得到:ImportError:Nomodulenamedpxssh我在Python安装中找到了这个文件,所以我猜是正确的:/usr/lib/python2.7/site-packages/pexpect/pxssh.py当然,我正在使用Python2.7运行我的应用程序,我什至尝试导入pexpect,但这没有帮助。 最佳答案 好吧,试试frompexpectimportpxssh。更新:该解决方案仅适用于Linux,因为Windows不支持pxssh