Reputation: 3
I'd like to use pyhdf in python3 with VS2022.OS is Windows10.
I executed the command "pip install pyhdf
" however I got this error message.
Collecting pyhdf
Using cached pyhdf-0.11.4.tar.gz (146 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in c:\users\usrname\appdata\local\programs\python\python37-32\lib\site-packages (from pyhdf) (1.21.6)
Building wheels for collected packages: pyhdf
Building wheel for pyhdf (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyhdf (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [163 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-cpython-37
creating build\lib.win32-cpython-37\pyhdf
copying pyhdf\error.py -> build\lib.win32-cpython-37\pyhdf
copying pyhdf\HC.py -> build\lib.win32-cpython-37\pyhdf
copying pyhdf\HDF.py -> build\lib.win32-cpython-37\pyhdf
copying pyhdf\hdfext.py -> build\lib.win32-cpython-37\pyhdf
copying pyhdf\SD.py -> build\lib.win32-cpython-37\pyhdf
copying pyhdf\six.py -> build\lib.win32-cpython-37\pyhdf
copying pyhdf\test_SD.py -> build\lib.win32-cpython-37\pyhdf
copying pyhdf\V.py -> build\lib.win32-cpython-37\pyhdf
copying pyhdf\VS.py -> build\lib.win32-cpython-37\pyhdf
copying pyhdf\__init__.py -> build\lib.win32-cpython-37\pyhdf
running egg_info
writing pyhdf.egg-info\PKG-INFO
writing dependency_links to pyhdf.egg-info\dependency_links.txt
writing requirements to pyhdf.egg-info\requires.txt
writing top-level names to pyhdf.egg-info\top_level.txt
reading manifest file 'pyhdf.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'doc\_build'
adding license file 'LICENSE'
adding license file 'AUTHORS'
writing manifest file 'pyhdf.egg-info\SOURCES.txt'
copying pyhdf\hdfext.i -> build\lib.win32-cpython-37\pyhdf
copying pyhdf\hdfext_wrap.c -> build\lib.win32-cpython-37\pyhdf
running build_ext
building 'pyhdf._hdfext' extension
creating build\temp.win32-cpython-37
creating build\temp.win32-cpython-37\Release
creating build\temp.win32-cpython-37\Release\pyhdf
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\usrname\AppData\Local\Temp\pip-build-env-phg_6zx2\overlay\Lib\site-packages\numpy\core\include -IC:\Users\usrname\AppData\Local\Programs\Python\Python37-32\include -IC:\Users\usrname\AppData\Local\Programs\Python\Python37-32\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /Tcpyhdf/hdfext_wrap.c /Fobuild\temp.win32-cpython-37\Release\pyhdf/hdfext_wrap.obj -DNOSZIP
hdfext_wrap.c
pyhdf/hdfext_wrap.c(4119): warning C4133: 'function': incompatible types - from 'int32 *' to 'comp_coder_t *'
pyhdf/hdfext_wrap.c(6049): warning C4090: 'function': different 'const' qualifiers
pyhdf/hdfext_wrap.c(6591): warning C4090: 'function': different 'const' qualifiers
pyhdf/hdfext_wrap.c(7241): warning C4090: 'function': different 'const' qualifiers
pyhdf/hdfext_wrap.c(7275): warning C4090: 'function': different 'const' qualifiers
pyhdf/hdfext_wrap.c(7275): warning C4090: 'function': different 'const' qualifiers
pyhdf/hdfext_wrap.c(8160): warning C4090: 'function': different 'const' qualifiers
pyhdf/hdfext_wrap.c(8604): warning C4090: 'function': different 'const' qualifiers
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX86\x86\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\usrname\AppData\Local\Programs\Python\Python37-32\libs /LIBPATH:C:\Users\usrname\AppData\Local\Programs\Python\Python37-32 /LIBPATH:C:\Users\usrname\AppData\Local\Programs\Python\Python37-32\PCbuild\win32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x86" mfhdf.lib hdf.lib xdr.lib libjpeg.lib zlib.lib ws2_32.lib /EXPORT:PyInit__hdfext build\temp.win32-cpython-37\Release\pyhdf/hdfext_wrap.obj /OUT:build\lib.win32-cpython-37\pyhdf\_hdfext.cp37-win32.pyd /IMPLIB:build\temp.win32-cpython-37\Release\pyhdf\_hdfext.cp37-win32.lib
Creating library build\temp.win32-cpython-37\Release\pyhdf\_hdfext.cp37-win32.lib and object build\temp.win32-cpython-37\Release\pyhdf\_hdfext.cp37-win32.exp
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vdelete
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSsetclass
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSnattrs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Hgetfileversion
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSfexist
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetfillmode
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSsizeof
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VHstoredata
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSsetattr
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDend
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VQuerytag
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDstart
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Hclose
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSwrite
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vgetversion
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDendaccess
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VFfieldesize
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vgetclass
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDgetdatastrs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDgetinfo
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetcal
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSisattr
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSsetinterlace
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDgetcal
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vinsert
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSQueryref
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vsetclass
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetattr
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDcheckempty
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Hopen
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vaddtagref
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDnametoindex
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetcompress
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vgettagrefs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetdimstrs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VFfieldname
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSQuerytag
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSfind
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vdetach
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VFfieldtype
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Hgetlibversion
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vfindclass
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSattrinfo
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDgetdimstrs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDreftoindex
hdfext_wrap.obj : error LNK2001: unresolved external symbol _HEvalue
hdfext_wrap.obj : error LNK2001: unresolved external symbol _HEstring
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSread
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSfindex
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDgetcompress
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDgetdimid
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vgettagref
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSgetclass
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSfnattrs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vgetattr
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDiscoordvar
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vntagrefs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDgetrange
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VHstoredatam
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VFfieldisize
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSdetach
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDreadattr
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vgetname
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Visvg
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSattach
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vgetid
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSsetname
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSfpack
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vfind
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDreaddata
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vinitialize
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDfindattr
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vnattrs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Hishdf
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDselect
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSfindattr
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSgetfields
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetdimscale
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDfileinfo
hdfext_wrap.obj : error LNK2001: unresolved external symbol _HEprint
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vdeletetagref
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vfindattr
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetrange
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vinqtagref
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDcreate
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSfdefine
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vattach
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSgetname
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetdimname
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDattrinfo
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDgetfillvalue
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VQueryref
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vfinish
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDisrecord
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vattrinfo
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSgetid
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSgetattr
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDgetdimscale
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vnrefs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vsetname
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSseek
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSinquire
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VFnfields
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Visvs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSsetfields
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSgetinterlace
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetfillvalue
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VFfieldorder
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetexternalfile
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDsetdatastrs
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDidtoref
hdfext_wrap.obj : error LNK2001: unresolved external symbol _VSelts
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDdiminfo
hdfext_wrap.obj : error LNK2001: unresolved external symbol _SDwritedata
hdfext_wrap.obj : error LNK2001: unresolved external symbol _Vsetattr
build\lib.win32-cpython-37\pyhdf\_hdfext.cp37-win32.pyd : fatal error LNK1120: 115 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX86\\x86\\link.exe' failed with exit code 1120
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyhdf
Failed to build pyhdf
ERROR: Could not build wheels for pyhdf, which is required to install pyproject.toml-based projects
Other modules can be installed so I think it's because the source code of pyhdf has something wrong with correspondence to VS, but I have no idea how to confirm and solve it. Any help would be greatly appreciated.
Upvotes: 0
Views: 48
Reputation: 16
It's a linker error, did you configured Vistual Studio with your python correctly ?
And what is your python version, did you configure an pyenv by any chance ?
Upvotes: 0