草庐IT

name-status

全部标签

python - "No driver name specified"将 pandas 数据框写入 SQL Server 表

我正在尝试将Pandas的DataFrame写入SQLServer表中。这是我的例子:importpyodbcimportpandasaspdimportsqlalchemydf=pd.DataFrame({'MDN':[242342342]})engine=sqlalchemy.create_engine('mssql://localhost/Sandbox?trusted_connection=yes')df.to_sql('Test',engine,if_exists='append',index=False)我收到以下错误消息。关于如何修复的任何想法?c:\python34\l

python - 如果要检查 recv_ready(),是否必须检查 exit_status_ready?

我正在运行一个远程命令:ssh=paramiko.SSHClient()ssh.connect(host)stdin,stdout,stderr=ssh.exec_command(cmd)现在我想得到输出。我见过这样的事情:#Waitforthecommandtofinishwhilenotstdout.channel.exit_status_ready():ifstdout.channel.recv_ready():stdoutLines=stdout.readlines()但有时似乎永远不会运行readlines()(即使标准输出上应该有数据)。这对我来说似乎意味着stdout.c

Python 请求 ImportError : cannot import name HeaderParsingError

操作系统:MacOSX。当我尝试运行下面的代码时,出现错误:ImportError:cannotimportnameHeaderParsingError我在代码下方附加了回溯。我已经尝试使用Google和其他stackoverflow解决这个问题20分钟了。我试过运行:pipinstallurllib3--upgrade我也试过重新安装请求包。它没有帮助。这似乎是我的请求或urllib3包的问题。有没有人遇到过类似的问题?代码:importrequestsimportjsondefprintResponse(r):print'{}{}\n'.format(json.dumps(r.js

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

Feign 调用出现异常:feign.FeignException: status 401 reading xxx#xxx(xxx)

异常描述微服务Controller层方法通过Feign调用某个微服务方法,出现以下异常:feign.FeignException:status401readingUserFeign#updateLoginTime(Integer) atfeign.FeignException.errorStatus(FeignException.java:78) atfeign.codec.ErrorDecoder$Default.decode(ErrorDecoder.java:93) atfeign.SynchronousMethodHandler.executeAndDecode(Synchronous

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