草庐IT

sd_bus_request_name

全部标签

python - 导入错误 : No module named flask. ext.sqlalchemy 在 vi​​rtualenv

这是我尝试在python3中运行以下代码时遇到的主要错误fromflask_sqlalchemyimportSQLAlchemyTraceback(mostrecentcalllast):File"/home/jsnyder10/.local/bin/flask",line11,insys.exit(main())File"/home/jsnyder10/.local/lib/python3.5/site-packages/flask/cli.py",line513,inmaincli.main(args=args,prog_name=name)File"/home/jsnyder10

python - 在 Windows 10 上使用 Python 3.7 时出现 "ModuleNotFoundError: No module named ' pysqlcipher3 '"错误

我正在尝试使用Python3.7解密一个数据库文件。要解密它,我必须使用适用于python3.7的pysqlcipher3版本。要安装它,我尝试使用这两个命令:pip3installpysqlcipher3和pipinstallpysqlcipher3并且这两个命令都显示成功安装了pysqlcipher包。但是,当我尝试使用此行在我的Python项目中导入pysqlcipher3时:frompysqlcipher3importdbapi2assqlite它显示这个错误:ModuleNotFoundError:Nomodulenamed'pysqlcipher3我检查了各种GitHub项

python - TensorFlow 安装导致 ImportError : No module named tensorflow

我正在尝试让TensorFlow在我的Mac(OSXElCapitan10.11.2)上运行。我尝试了setupguide中的pipinstall并按照theacceptedanswerhere中的说明进行操作.在这两种情况下,我都能够成功激活virtualenv并且我的提示更改为tensorflow.Python工作正常,我能够在命令行上进行简单的计算。但是当我尝试导入tensorflow时:importtensorflowastf我反复收到这个错误:ImportError:Nomodulenamedtensorflow如有任何帮助,我们将不胜感激。 最佳

python - Nosetest 和 Google API : "no module named apiclient.discovery"

我正在尝试对使用GoogleTranslateAPI的Python小脚本进行Nose测试。我必须在哪里安装API或者我必须做什么才能让nosetest停止告诉我ImportError:Nomodulenamedapiclient.discovery脚本运行良好,我按照您的方式导入它并使用pip安装它,但我找不到任何关于如何使用nosetest使其工作的信息。任何帮助将不胜感激!:) 最佳答案 Thescriptrunsfine,Iimportitasyouwouldandinstalleditwithpip,butIcan'tfin

.NET 的 Python : ImportError: No module named warnings

我正在尝试将python2.6嵌入到.NET4.0中。根据“Pythonfor.NET”中非常简单的文档,我编写了一段相当简单的代码,如下所示:conststringpythonModulePath=@"C:\Projects\PythonImport\PythonImport\test.py";Environment.SetEnvironmentVariable("PYTHONHOME",Path.GetDirectoryName(pythonModulePath));PythonEngine.Initialize();varoldWorkingDirectory=Directory

python - 日期时间 : conversion from string with timezone name not working

我有以下字符串"2017-03-3008:25:00CET"我想将其转换为datetimetz-aware对象。根据thisSOquestion,从python3.2开始,它可以只使用datetime模块来完成。此外,来自documentation,我明白了%z|UTCoffsetintheform+HHMMor-HHMM(emptystringiftheobjectisnaive).|(empty),+0000,-0400,+1030%Z|Timezonename(emptystringiftheobjectisnaive).|(empty),UTC,EST,CST所以我尝试以下da

python - 再次 urllib.error.HTTPError : HTTP Error 400: Bad Request

喂!我试图打开通常在浏览器中打开的网页,但python只是发誓并且不想工作。importurllib.request,urllib.errorf=urllib.request.urlopen('http://www.booking.com/reviewlist.html?cc1=tr;pagename=sapphire')另一种方式importurllib.request,urllib.erroropener=urllib.request.build_opener()f=opener.open('http://www.booking.com/reviewlist.html?cc1=tr

Python:requests.get,循环迭代url

我试图通过在for循环中迭代requests.get(url)来从stats.nba.com获取信息,其中url在每次迭代时都会发生变化。如果我只是在它工作后对其进行迭代,但两次或更多次似乎会出错,我不确定为什么。我是编程新手,所以任何信息都会有所帮助。提前致谢。这是我的代码:importrequestsimportjsonteam_id=1610612737defget_data(url):response=requests.get(url)ifresponse.status_code==200:data=response.json()returndataelse:print(res

Python ctypes.WinDLL 错误,找不到 _dlopen(self._name, mode)

ctypes.WinDLL("C:\ProgramFiles\AHSDK\bin\ahscript.dll")Traceback(mostrecentcalllast):File"",line1,inFile"C:\Python26\lib\ctypes\__init__.py",line353,in__init__self._handle=_dlopen(self._name,mode)WindowsError:[Error126]Thespecifiedmodulecouldnotbefound我该如何解决?我在C:\Python26\lib\ctypes\__init__.py中

python - 片状 8 : "multiple statements on one line (colon)" only for variable name starting with "if"

我在VisualStudioCode中使用flake8,使用Python3.6variableannotations编写一些代码.到目前为止它没有任何问题,但我遇到了一个奇怪的警告。这很好用:style:str="""width:100%;..."""#Doingsthwith`style`这也是:img_style:str="""width:100%;..."""#Doingsthwith`img_style`但这并没有,它会产生以下警告:iframe_style:str="""width:100%;..."""#Doingsthwith`iframe_style`嗯,从技术上讲它确