1

我的工作环境

  • 操作系统平台、发行版和版本:Window 10 Education 64 位(10.0,Build 17134**:
  • 从(源或二进制)安装:从源(pip install -i https://pypi.anaconda.org/gpuopenanalytics/simple h2o4gpu)
  • 版本:0.1.0
  • Python 版本(可选):3.7.1
  • CUDA/cuDNN 版本:CUDA V10.0.130
  • GPU型号(可选):Nvidia GTX 1070
  • CPU型号:英特尔i7 7700K
  • 可用内存:16GB

描述

我正在尝试在 python 中安装 h2o4gpu。我通过上面链接的源成功安装了它。我也尝试通过 .whl 文件。

输入时import h2o4gp出现以下错误:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-f0f8409ece6e> in <module>()
----> 1 import h2o4gpu

~\Anaconda3\lib\site-packages\h2o4gpu\__init__.py in <module>()
      9 
     10 from .types import FunctionVector
---> 11 from .solvers.pogs import Pogs
     12 from .solvers.elastic_net import ElasticNet
     13 from .solvers.elastic_net import ElasticNetH2O

~\Anaconda3\lib\site-packages\h2o4gpu\solvers\__init__.py in <module>()
      6 
      7 from ..solvers.pogs import Pogs
----> 8 from ..solvers.elastic_net import ElasticNetH2O
      9 from ..solvers.elastic_net import ElasticNet
     10 from ..solvers.logistic import LogisticRegression

~\Anaconda3\lib\site-packages\h2o4gpu\solvers\elastic_net.py in <module>()
     12 import numpy as np
     13 import pandas as pd
---> 14 from h2o4gpu.linear_model import coordinate_descent as sk
     15 from tabulate import tabulate
     16 from ..solvers.utils import _setter

~\Anaconda3\lib\site-packages\h2o4gpu\linear_model\__init__.py in <module>()
     10 # complete documentation.
     11 
---> 12 from .base import LinearRegressionSklearn
     13 
     14 from .bayes import BayesianRidgeSklearn, ARDRegression

~\Anaconda3\lib\site-packages\h2o4gpu\linear_model\base.py in <module>()
     26 from ..externals import six
     27 from ..externals.joblib import Parallel, delayed
---> 28 from ..base import BaseEstimator, ClassifierMixin, RegressorMixin
     29 from ..utils import check_array, check_X_y, deprecated, as_float_array
     30 from ..utils.validation import FLOAT_DTYPES

~\Anaconda3\lib\site-packages\h2o4gpu\base.py in <module>()
     10 from scipy import sparse
     11 from .externals import six
---> 12 from .utils.fixes import signature
     13 from . import __version__
     14 

~\Anaconda3\lib\site-packages\h2o4gpu\utils\__init__.py in <module>()
      8 import warnings
      9 
---> 10 from .murmurhash import murmurhash3_32
     11 from .validation import (as_float_array,
     12                          assert_all_finite,

ModuleNotFoundError: No module named 'h2o4gpu.utils.murmurhash'
-------------------------------

这里的问题似乎是模块h2o4gpu.utils.murmurhash,现在github上有一个类似的问题(https://github.com/h2oai/h2o4gpu/issues/654)。但是我似乎无法用它来解决我的问题。

经过调查,我发现输入import murmurhashpython 确实有效。导致问题的原因是 h2o4gpu 调用: requires from .murmurhash import murmurhash3_32导致导入中断的是 murmruhash3 模块。

我似乎无法解决这个问题。尝试-pip install murmurhash3从 C++ 2015 x86 x64 Cross Build Tools 命令提示符或正常命令提示符运行时,会出现以下错误:

> C:\Users\Luca>python -m pip install murmurhash3 Collecting murmurhash3
> Using cached
> https://files.pythonhosted.org/packages/b5/f4/1f9c4851667a2541bd151b8d9efef707495816274fada365fa6a31085a32/murmurhash3-2.3.5.tar.gz
> Building wheels for collected packages: murmurhash3   Running setup.py
> bdist_wheel for murmurhash3 ... error   Complete output from command
> C:\Users\Luca\Anaconda3\python.exe -u -c "import setuptools,
> tokenize;__file__='C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-install-h4n7nie1\\murmurhash3\\setup.py';f=getattr(tokenize,
> 'open', open)(__file__);code=f.read().replace('\r\n',
> '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d
> C:\Users\Luca\AppData\Local\Temp\pip-wheel-80aw13s0 --python-tag cp37:
> running bdist_wheel   running build   running build_ext   building
> 'mmh3' extension   creating build   creating build\temp.win-amd64-3.7 
> creating build\temp.win-amd64-3.7\Release   C:\Program Files
> (x86)\Microsoft Visual
> Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe
> /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Luca\Anaconda3\include
> -IC:\Users\Luca\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include"
> "-IC:\Program Files (x86)\Microsoft Visual
> Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program
> Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program
> Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program
> Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program
> Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program
> Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc
> /Tpmmh3module.cpp /Fobuild\temp.win-amd64-3.7\Release\mmh3module.obj  
> mmh3module.cpp  
> c:\users\luca\appdata\local\temp\pip-install-h4n7nie1\murmurhash3\murmur_hash_3.hpp(5):
> error C2371: 'uint32_t': redefinition; different basic types  
> C:\Program Files (x86)\Microsoft Visual
> Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\stdint.h(23):
> note: see declaration of 'uint32_t'   mmh3module.cpp(9): error C2371:
> 'int32_t': redefinition; different basic types   C:\Program Files
> (x86)\Microsoft Visual
> Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\stdint.h(19):
> note: see declaration of 'int32_t'   mmh3module.cpp(12): error C2371:
> 'uint32_t': redefinition; different basic types   C:\Program Files
> (x86)\Microsoft Visual
> Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\stdint.h(23):
> note: see declaration of 'uint32_t'   error: command 'C:\\Program
> Files (x86)\\Microsoft Visual
> Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe'
> failed with exit status 2
> 
>   ----------------------------------------   Failed building wheel for
> murmurhash3   Running setup.py clean for murmurhash3 Failed to build
> murmurhash3 Installing collected packages: murmurhash3   Running
> setup.py install for murmurhash3 ... error
>     Complete output from command C:\Users\Luca\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-install-h4n7nie1\\murmurhash3\\setup.py';f=getattr(tokenize,
> 'open', open)(__file__);code=f.read().replace('\r\n',
> '\n');f.close();exec(compile(code, __file__, 'exec'))" install
> --record C:\Users\Luca\AppData\Local\Temp\pip-record-uhxkr167\install-record.txt
> --single-version-externally-managed --compile:
>     running install
>     running build
>     running build_ext
>     building 'mmh3' extension
>     creating build
>     creating build\temp.win-amd64-3.7
>     creating build\temp.win-amd64-3.7\Release
>     C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe
> /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Luca\Anaconda3\include
> -IC:\Users\Luca\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include"
> "-IC:\Program Files (x86)\Microsoft Visual
> Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program
> Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program
> Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program
> Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program
> Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program
> Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc
> /Tpmmh3module.cpp /Fobuild\temp.win-amd64-3.7\Release\mmh3module.obj
>     mmh3module.cpp
>     c:\users\luca\appdata\local\temp\pip-install-h4n7nie1\murmurhash3\murmur_hash_3.hpp(5):
> error C2371: 'uint32_t': redefinition; different basic types
>     C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\stdint.h(23):
> note: see declaration of 'uint32_t'
>     mmh3module.cpp(9): error C2371: 'int32_t': redefinition; different basic types
>     C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\stdint.h(19):
> note: see declaration of 'int32_t'
>     mmh3module.cpp(12): error C2371: 'uint32_t': redefinition; different basic types
>     C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\stdint.h(23):
> note: see declaration of 'uint32_t'
>     error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe'
> failed with exit status 2
> 
>     ---------------------------------------- Command "C:\Users\Luca\Anaconda3\python.exe -u -c "import setuptools,
> tokenize;__file__='C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-install-h4n7nie1\\murmurhash3\\setup.py';f=getattr(tokenize,
> 'open', open)(__file__);code=f.read().replace('\r\n',
> '\n');f.close();exec(compile(code, __file__, 'exec'))" install
> --record C:\Users\Luca\AppData\Local\Temp\pip-record-uhxkr167\install-record.txt
> --single-version-externally-managed --compile" failed with error code 1 in
> C:\Users\Luca\AppData\Local\Temp\pip-install-h4n7nie1\murmurhash3\

这里的摘要问题是:

  • c:\users\luca\appdata\local\temp\pip-install-h4n7nie1\murmurhash3\murmur_hash_3.hpp(5): error C2371: 'uint32_t': redefinition; different basic types
  • C:\Program Files (x86)\Microsoft VisualStudio\2017\Community\VC\Tools\MSVC\14.16.27023\include\stdint.h(23): note: see declaration of 'uint32_t' mmh3module.cpp(9): error C2371
  • error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe: failed with exit status 2

任何帮助转发将不胜感激

4

0 回答 0