草庐IT

transformers_modules

全部标签

Python、PyInstaller 错误 : no module named "Encodings" and system codec missing

我正在使用Python3.3.3,我一直在尝试从一个简单的.py脚本构建一个.exe。我的脚本是这样的:importencodingsprint('Test')并正确执行。当我尝试使用PyInstaller使用此命令构建它时:pyinstaller--onefileTestmodul.py然后尝试打开我的.exe,它显示了这个错误:Pythonfatalerror:Py_Initialize:无法加载文件系统编解码器,ImportError:没有名为“encodings”的模块我已经尝试在我的测试脚本中导入“编码”模块,但它仍然无法正常工作,我也尝试过py2exe,但它也根本无法正常工

python - 导入错误 : Environment variable DJANGO_SETTINGS_MODULE is undefined

我正在学习基本的django教程,我正在使用pythonmanage.pyrunserver运行服务器。我收到这个错误,我不太明白如何解决:Traceback(mostrecentcalllast):File"manage.py",line1,infrompolls.modelsimportPollFile"/Users/davidhaddad/Desktop/mysite/polls/models.py",line2,infromdjango.dbimportmodelsFile"/Library/Frameworks/Python.framework/Versions/2.7/li

python - 导入错误 : Environment variable DJANGO_SETTINGS_MODULE is undefined

我正在学习基本的django教程,我正在使用pythonmanage.pyrunserver运行服务器。我收到这个错误,我不太明白如何解决:Traceback(mostrecentcalllast):File"manage.py",line1,infrompolls.modelsimportPollFile"/Users/davidhaddad/Desktop/mysite/polls/models.py",line2,infromdjango.dbimportmodelsFile"/Library/Frameworks/Python.framework/Versions/2.7/li

python - Gauss-Legendre 区间 -x -> 无穷大 : adaptive algorithm to transform weights and nodes efficiently

好的,我知道之前有人用一个有限的缩放示例问过这个问题[-1,1]间隔[a,b]DifferentintervalsforGauss-Legendrequadratureinnumpy但是没有人发布如何将其概括为[-a,Infinity](正如下面所做的,但不是(还)快)。这也展示了如何使用多个实现调用复杂函数(无论如何在定量期权定价中)。有基准quad代码,后跟leggauss,以及有关如何实现自适应算法的代码示例的链接。我已经完成了大部分链接adaptivealgorithmdifficulties-它目前打印除积分的总和以表明它工作正常。在这里您可以找到将范围从[-1,1]转换的函

python - Gauss-Legendre 区间 -x -> 无穷大 : adaptive algorithm to transform weights and nodes efficiently

好的,我知道之前有人用一个有限的缩放示例问过这个问题[-1,1]间隔[a,b]DifferentintervalsforGauss-Legendrequadratureinnumpy但是没有人发布如何将其概括为[-a,Infinity](正如下面所做的,但不是(还)快)。这也展示了如何使用多个实现调用复杂函数(无论如何在定量期权定价中)。有基准quad代码,后跟leggauss,以及有关如何实现自适应算法的代码示例的链接。我已经完成了大部分链接adaptivealgorithmdifficulties-它目前打印除积分的总和以表明它工作正常。在这里您可以找到将范围从[-1,1]转换的函

python - torch ,属性错误: module 'torch' has no attribute 'Tensor'

我在装有CentOSLinux7.3.1611(核心)操作系统的计算机上使用Python3.5.1。我正在尝试使用PyTorch并开始使用thistutorial.不幸的是,示例的#4行造成了麻烦:>>>torch.Tensor(5,3)Traceback(mostrecentcalllast):File"",line1,inAttributeError:module'torch'hasnoattribute'Tensor'我无法理解这个错误……当然在Torch中,“torch”确实有一个属性“Tensor”。相同的命令适用于Torch。我该如何解决这个问题?

python - torch ,属性错误: module 'torch' has no attribute 'Tensor'

我在装有CentOSLinux7.3.1611(核心)操作系统的计算机上使用Python3.5.1。我正在尝试使用PyTorch并开始使用thistutorial.不幸的是,示例的#4行造成了麻烦:>>>torch.Tensor(5,3)Traceback(mostrecentcalllast):File"",line1,inAttributeError:module'torch'hasnoattribute'Tensor'我无法理解这个错误……当然在Torch中,“torch”确实有一个属性“Tensor”。相同的命令适用于Torch。我该如何解决这个问题?

python - 属性错误 : 'module' object (scipy) has no attribute *** Why does this error occur?

在scipy中,这个错误经常发生。>>>importscipy>>>scipy.integrate.trapz(gyroSeries,timeSeries)Traceback(mostrecentcalllast):File"",line1,inAttributeError:'module'objecthasnoattribute'integrate'>>>我想出了如何通过执行以下操作来解决这个问题:>>>>>>importscipy.integrate>>>scipy.integrate.trapz(gyroSeries,timeSeries)>>>1.2我的问题:为什么会出现这个错

python - 属性错误 : 'module' object (scipy) has no attribute *** Why does this error occur?

在scipy中,这个错误经常发生。>>>importscipy>>>scipy.integrate.trapz(gyroSeries,timeSeries)Traceback(mostrecentcalllast):File"",line1,inAttributeError:'module'objecthasnoattribute'integrate'>>>我想出了如何通过执行以下操作来解决这个问题:>>>>>>importscipy.integrate>>>scipy.integrate.trapz(gyroSeries,timeSeries)>>>1.2我的问题:为什么会出现这个错

python - Flask - ImportError : No module named migrate. 版本控制

我正在学习flask教程,并尝试运行一个创建数据库的脚本,而不是通过命令行来创建。它使用SQLAlchemy-migrate包,但是当我尝试运行脚本时,它给出了ImportError。这是终端输出:Sean:appseanpatterson$python./db_create.pyTraceback(mostrecentcalllast):File"./db_create.py",line2,infrommigrate.versioningimportapiImportError:Nomodulenamedmigrate.versioning这是db_create.py脚本:#!fla