如何解决“ImportError:DLL load failed:”的fancyicomputer之前工作

2024-10-01 09:35:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我以前可以成功地从一个Jupyterlab笔记本中导入fancyicompute模块,而不是其他笔记本。重新启动我的电脑后,所有笔记本电脑都会失败,并显示一个ImportError:DLL load failed:找不到指定的过程。“

为什么它在一个标签上有效,而在另一个标签上没有? 而且,更令人担忧的是,为什么它会停止一起工作?在

其他一些关于类似错误的帖子指出,这可能与系统路径我调查过了。它工作的笔记本和不工作的笔记本之间的唯一区别是,它工作的那一个缺少factor iu analyzer-0.3.1-py3.6.egg的条目,这是我打开笔记本后添加的。在

我调查了搜索路径对于它工作的笔记本来说,它是这样的(我手动输入回车以使其更清晰):

['C:\\Users\\laure\\Anaconda3\\envs\\scipy18jlab\\python36.zip', 
'C:\\Users\\laure\\Anaconda3\\envs\\scipy18jlab\\DLLs', 
'C:\\Users\\laure\\Anaconda3\\envs\\scipy18jlab\\lib', 
'C:\\Users\\laure\\Anaconda3\\envs\\scipy18jlab', 
'', 
'C:\\Users\\laure\\Anaconda3\\envs\\scipy18jlab\\lib\\site-packages', 
'C:\\Users\\laure\\Anaconda3\\envs\\scipy18jlab\\lib\\site-packages\\IPython\\extensions', 
'C:\\Users\\laure\\.ipython']

对于那些没有的人:

^{pr2}$

产生错误的代码是:

^{3}$

错误信息是:

Using TensorFlow backend.
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-5-64b839002688> in <module>
----> 1 from fancyimpute import KNN, NuclearNormMinimization, SoftImpute, IterativeImputer, BiScaler, SimpleFill

~\Anaconda3\envs\scipy18jlab\lib\site-packages\fancyimpute\__init__.py in <module>
      4 from .nuclear_norm_minimization import NuclearNormMinimization
      5 from .iterative_imputer import IterativeImputer
----> 6 from .matrix_factorization import MatrixFactorization
      7 from .iterative_svd import IterativeSVD
      8 from .simple_fill import SimpleFill

~\Anaconda3\envs\scipy18jlab\lib\site-packages\fancyimpute\matrix_factorization.py in <module>
     14 
     15 import numpy as np
---> 16 from keras import regularizers
     17 from keras.callbacks import EarlyStopping
     18 from keras.layers import Input

~\Anaconda3\envs\scipy18jlab\lib\site-packages\keras\__init__.py in <module>
      1 from __future__ import absolute_import
      2 
----> 3 from . import utils
      4 from . import activations
      5 from . import applications

~\Anaconda3\envs\scipy18jlab\lib\site-packages\keras\utils\__init__.py in <module>
      4 from . import data_utils
      5 from . import io_utils
----> 6 from . import conv_utils
      7 
      8 # Globally-importable utils.

~\Anaconda3\envs\scipy18jlab\lib\site-packages\keras\utils\conv_utils.py in <module>
      7 from six.moves import range
      8 import numpy as np
----> 9 from .. import backend as K
     10 
     11 

~\Anaconda3\envs\scipy18jlab\lib\site-packages\keras\backend\__init__.py in <module>
     87 elif _BACKEND == 'tensorflow':
     88     sys.stderr.write('Using TensorFlow backend.\n')
---> 89     from .tensorflow_backend import *
     90 else:
     91     # Try and load external backend.

~\Anaconda3\envs\scipy18jlab\lib\site-packages\keras\backend\tensorflow_backend.py in <module>
      3 from __future__ import print_function
      4 
----> 5 import tensorflow as tf
      6 from tensorflow.python.framework import ops as tf_ops
      7 from tensorflow.python.training import moving_averages

~\Anaconda3\envs\scipy18jlab\lib\site-packages\tensorflow\__init__.py in <module>
     22 
     23 # pylint: disable=g-bad-import-order
---> 24 from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
     25 
     26 from tensorflow._api.v1 import app

~\Anaconda3\envs\scipy18jlab\lib\site-packages\tensorflow\python\__init__.py in <module>
     50 
     51 # Protocol buffers
---> 52 from tensorflow.core.framework.graph_pb2 import *
     53 from tensorflow.core.framework.node_def_pb2 import *
     54 from tensorflow.core.framework.summary_pb2 import *

~\Anaconda3\envs\scipy18jlab\lib\site-packages\tensorflow\core\framework\graph_pb2.py in <module>
      4 import sys
      5 _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
----> 6 from google.protobuf import descriptor as _descriptor
      7 from google.protobuf import message as _message
      8 from google.protobuf import reflection as _reflection

~\Anaconda3\envs\scipy18jlab\lib\site-packages\google\protobuf\descriptor.py in <module>
     45   import binascii
     46   import os
---> 47   from google.protobuf.pyext import _message
     48   _USE_C_DESCRIPTORS = getattr(_message, '_USE_C_DESCRIPTORS', False)
     49 

ImportError: DLL load failed: The specified procedure could not be found.

关于调查和解决这个问题的任何建议谢谢。还有如果我需要提供更多关于环境的细节,请告诉我。在

!pip list

给出:

Package              Version    
-------------------- -----------
absl-py              0.7.1      
appdirs              1.4.3      
arrow                0.13.1     
asn1crypto           0.24.0     
astor                0.7.1      
attrs                18.2.0     
backcall             0.1.0      
beautifulsoup4       4.5.3      
binaryornot          0.4.4      
bleach               3.1.0      
bqplot               0.11.5     
CausalInference      0.1.2      
certifi              2019.3.9   
cffi                 1.12.0     
chardet              3.0.4      
Click                7.0        
colorama             0.4.1      
cookiecutter         1.6.0      
country-converter    0.6.6      
cryptography         2.3.1      
CVXcanon             0.1.1      
cvxpy                1.0.21     
cycler               0.10.0     
decorator            4.3.2      
defusedxml           0.6.0      
dill                 0.2.9      
distro               1.4.0      
ecos                 2.0.7.post1
entrypoints          0.3        
factor-analyzer      0.3.1      
fancyimpute          0.4.3      
fastcache            1.0.2      
future               0.17.1     
gast                 0.2.2      
grpcio               1.20.1     
h5py                 2.9.0      
html-table-extractor 1.3.0      
idna                 2.8        
impyute              0.0.7      
ipydatawidgets       4.0.0      
ipykernel            5.1.0      
ipyscales            0.3.0      
ipython              7.2.0      
ipython-genutils     0.2.0      
ipywidgets           7.4.2      
jedi                 0.13.2     
Jinja2               2.10       
jinja2-time          0.2.0      
jsonschema           3.0.0a3    
jupyter-client       5.2.4      
jupyter-core         4.4.0      
jupyterlab           0.35.4     
jupyterlab-server    0.2.0      
Keras                2.2.4      
Keras-Applications   1.0.7      
Keras-Preprocessing  1.0.9      
kiwisolver           1.1.0      
knnimpute            0.1.0      
lxml                 4.3.1      
Markdown             3.1        
MarkupSafe           1.1.0      
matplotlib           3.0.3      
missingno            0.4.1      
mistune              0.8.4      
mkl-fft              1.0.10     
mkl-random           1.0.2      
mock                 2.0.0      
multiprocess         0.70.7     
nbconvert            5.5.0      
nbformat             4.4.0      
notebook             5.5.0      
np-utils             0.5.10.0   
numpy                1.16.3     
osqp                 0.5.0      
packaging            19.0       
pandas               0.23.4     
pandas-datareader    0.7.0      
pandocfilters        1.4.2      
parso                0.3.4      
patsy                0.5.1      
pbr                  5.2.0      
pickleshare          0.7.5      
pip                  19.0.2     
poyo                 0.4.2      
prompt-toolkit       2.0.8      
protobuf             3.7.1      
pyarrow              0.13.0     
pycparser            2.19       
Pygments             2.3.1      
pyOpenSSL            19.0.0     
pyparsing            2.4.0      
PyPDF2               1.26.0     
pyrsistent           0.14.10    
PySocks              1.6.8      
python-dateutil      2.8.0      
pythreejs            2.0.2      
pytz                 2018.9     
pywinpty             0.5.5      
PyYAML               5.1        
pyzmq                17.1.2     
quilt                2.9.15     
requests             2.21.0     
scikit-learn         0.20.3     
scipy                1.2.1      
scs                  2.1.0      
seaborn              0.9.0      
Send2Trash           1.5.0      
setuptools           40.8.0     
six                  1.12.0     
statsmodels          0.9.0      
tabula-py            1.3.1      
tensorboard          1.13.1     
tensorflow           1.13.1     
tensorflow-estimator 1.13.0     
termcolor            1.1.0      
terminado            0.8.1      
testpath             0.4.2      
tornado              5.1.1      
tqdm                 4.31.1     
traitlets            4.3.2      
traittypes           0.2.1      
urllib3              1.24.1     
wbdata               0.2.7      
wcwidth              0.1.7      
webencodings         0.5.1      
Werkzeug             0.15.2     
wheel                0.33.0     
whichcraft           0.5.2      
widgetsnbextension   3.4.2      
win-inet-pton        1.0.1      
wincertstore         0.2        
wrapt                1.11.1     
xlrd                 1.2.0      
XlsxWriter           1.1.4      
xlwt                 1.3.0 

试图通过将protobuf降级到3.7.0来解决问题,并通过直接导入罪魁祸首进行测试:

from google.protobuf.pyext import _message

这给了

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-10-019e0ec86f84> in <module>
----> 1 from google.protobuf.pyext import _message

ImportError: DLL load failed: The specified procedure could not be found.

Tags: infrompyimportbackendlibpackagestensorflow