Python:DLL加载失败:%1不是有效的Win32应用程序

初中薄荷

我已经成功安装了最新版本的Numpy,并且使用的是Python 3.4,我不了解此错误:

Traceback (most recent call last):
  File "C:\Python34\LUdecomp.py", line 1, in <module>
    import numpy as np
  File "C:\Python34\lib\site-packages\numpy\__init__.py", line 170, in <module>
    from . import add_newdocs
  File "C:\Python34\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "C:\Python34\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
    from .type_check import *
  File "C:\Python34\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "C:\Python34\lib\site-packages\numpy\core\__init__.py", line 6, in <module>
    from . import multiarray
ImportError: DLL load failed: %1 is not a valid Win32 application.

代码:

import numpy as np
from sys import argv

script, filename = argv

txt = open(filename)

header = txt.readline().split()
inputArray = map(float, txt.readline().split())
txt.close()

inputMat = np.mat(inputArray)
inputMat.reshape(int(header[0]), int(header[1]))
inputMat.shape()

#takes q2data as input
def lu(A):
    #Decomposes a nxn matrix A by PA=LU and returns L, U and P.
    n = len(A)
    L = [[0.0] * n for i in xrange(n)]
    U = [[0.0] * n for i in xrange(n)]

    #Creates the pivoting matrix for m.
    n = len(A)
    ID = [[float(i == j) for i in xrange(n)] for j in xrange(n)]
    for j in xrange(n):
        row = max(xrange(j, n), key=lambda i: abs(A[i][j]))
        if j != row:
            ID[j], ID[row] = ID[row], ID[j]
    p = ID

    #perform matrix multplication
    TA = zip(*A)
    A2 = [[sum(eP*ea for eP,ea in zip(P,a)) for a in TA] for P in p]

    for j in xrange(n):
        L[j, j] = 1.0
        for i in xrange(j+1):
            s1 = sum(U[k, j] * L[i, k] for k in xrange(i))
            U[i, j] = A2[i, j] - s1
        for i in xrange(j, n):
            s2 = sum(U[k, j] * L[i, k] for k in xrange(j))
            L[i, j] = (A2[i, j] - s2) / U[j, j]
    return (L, U, p)

print (lu(inputMat))
帕德拉克·坎宁安

您已经安装了64 bitnumpy版本,并且正在使用32 bitpython版本,反之亦然。您可以从此处安装预构建的二进制文件

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

DLL加载失败:%1不是有效的Win32应用程序-Appcelerator

python cython ImportError:DLL加载失败:%1不是有效的Win32应用程序

ImportError:DLL加载失败:%1不是有效的Win32应用程序。但是DLL在那里

DLL加载失败-不是有效的Win32应用程序-使用NumPy

解决“ DLL加载失败:%1不是有效的Win32应用程序。” 对于Pygame

ImportError:DLL加载失败:%1不是_imaging模块的有效Win32应用程序

cx-freeze“ ImportError:DLL加载失败:%1不是有效的Win32应用程序”

在python中加载DLL时出错,不是有效的Win32应用程序

JNI C ++ DLL-'UnsatisfiedLinkError:%1不是有效的Win32应用程序'

PHP加载错误:%1不是有效的Win32应用程序。

Python [WinError 193]%1不是有效的Win32应用程序

无法加载动态库php_sqlsrv_7_nts.dll不是有效的Win32应用程序

无法加载 rJava.dll - 不是有效的 Win32 应用程序 - 安装 ReporteRsjars 时

Pycharm与Electron -Runnerw.exe:CreateProcess失败,错误193:%1不是有效的Win32应用程序

CreateProcess错误= 193,%1不是有效的Win32应用程序-> [帮助1]

OSError:[WinError 193]%1不是有效的Win32应用程序,同时使用CTypes读取python中的custim DLL

OSError:[WinError 193]%1不是有效的Win32应用程序

WinError 193]%1不是有效的Win32应用程序

Rails 3.2.1:%1不是有效的Win32应用程序。-c:/ RailsInstaller

错误:%1不是有效的Win32应用程序

psexec %1 不是有效的 Win32 应用程序

导入skimage不是有效的Win32应用程序python3

VLC.DotNet System.ComponentModel.Win32Exception:'%1不是有效的Win32应用程序'

用syscall调用mono-2.0-sgen.dll得到“不是有效的Win32应用程序”

php_oci8_11g.dll不是有效的Win32应用程序

IOException:无法运行程序:CreateProcess错误= 193,%1不是有效的Win32应用程序

节点js,%1不是有效的Win32应用程序,js-bson:无法加载c ++ bson扩展,Windows

为什么很少用“%1不是有效的Win32应用程序”代替%1。

启动安装程序时不是有效的win32应用程序