Open WangHHY19931001 opened 8 months ago
ImportError: DLL load failed while importing _ctypes:
probably some environment setting messing up python or an old vcpkg installation of x_vcpkg_get_python_packages where python is not run in isolation mode.
Uh,I found a really fun way to solve it. The python in D:\ProgramData\vcpkg\downloads\tools\python\python-3.11.8-x64 is not accurately configured by vcpkg. And There is no problem with the following pyton D:\ProgramData\vcpkg\installed\x64-windows\tools\python3 ,so I copy this python to
Now ,it's ok!
In the pc, installed conda, and it been add to path
after uninstall all python env, still error.
Package: libtorch[core,cuda,dist,fftw3,leveldb,llvm,opencv,vulkan,xnnpack,zstd]:x64-windows@2.1.2#1
Host Environment
To Reproduce
vcpkg install libtorch[llvm,vulkan,zstd,leveldb,fftw3,dist,cuda,opencv]:x64-windows openssl:x64-windows openssl:x64-windows-static cppcodec:x64-windows cppcodec:x64-windows-static
Failure logs
-- Downloading https://github.com/pytorch/pytorch/archive/v2.1.2.tar.gz -> pytorch-pytorch-v2.1.2.tar.gz...
-- Extracting source C:/vcpkg/downloads/pytorch-pytorch-v2.1.2.tar.gz
-- Applying patch cmake-fixes.patch
-- Applying patch more-fixes.patch
-- Applying patch fix-build.patch
-- Applying patch clang-cl.patch
-- Applying patch cuda-adjustments.patch
-- Applying patch fix-api-export.patch
-- Applying patch fix-onnx-case.patch
-- Applying patch fxdiv.patch
-- Applying patch protoc.patch
-- Applying patch fix-sleef.patch
-- Applying patch fix-glog.patch
-- Applying patch fix-msvc-ICE.patch
-- Applying patch fix-calculate-minloglevel.patch
-- Using source at C:/vcpkg/buildtrees/libtorch/src/v2.1.2-4fcdc1be04.clean
-- Downloading https://github.com/pytorch/kineto/archive/49e854d805d916b2031e337763928d2f8d2e1fbf.tar.gz -> pytorch-kineto-49e854d805d916b2031e337763928d2f8d2e1fbf.tar.gz...
-- Extracting source C:/vcpkg/downloads/pytorch-kineto-49e854d805d916b2031e337763928d2f8d2e1fbf.tar.gz
-- Applying patch kineto.patch
-- Using source at C:/vcpkg/buildtrees/libtorch/src/2f8d2e1fbf-de7a6d4b27.clean
-- Downloading https://github.com/NVIDIA/cudnn-frontend/archive/12f35fa2be5994c1106367cac2fba21457b064f4.tar.gz -> NVIDIA-cudnn-frontend-12f35fa2be5994c1106367cac2fba21457b064f4.tar.gz...
-- Extracting source C:/vcpkg/downloads/NVIDIA-cudnn-frontend-12f35fa2be5994c1106367cac2fba21457b064f4.tar.gz
-- Using source at C:/vcpkg/buildtrees/libtorch/src/1457b064f4-11f2c20faf.clean
-- Downloading https://github.com/NVIDIA/cutlass/archive/6f47420213f757831fae65c686aa471749fa8d60.tar.gz -> NVIDIA-cutlass-6f47420213f757831fae65c686aa471749fa8d60.tar.gz...
-- Extracting source C:/vcpkg/downloads/NVIDIA-cutlass-6f47420213f757831fae65c686aa471749fa8d60.tar.gz
-- Using source at C:/vcpkg/buildtrees/libtorch/src/1749fa8d60-777f8079ff.clean
-- Using flatc: C:/vcpkg/installed/x64-windows/tools/flatbuffers/flatc.exe
-- Using protoc: C:/vcpkg/installed/x64-windows/tools/protobuf/protoc.exe
-- Downloading https://github.com/pypa/get-pip/archive/38e54e5de07c66e875c11a1ebbdb938854625dd8.tar.gz -> pypa-get-pip-38e54e5de07c66e875c11a1ebbdb938854625dd8.tar.gz...
-- Extracting source C:/vcpkg/downloads/pypa-get-pip-38e54e5de07c66e875c11a1ebbdb938854625dd8.tar.gz
-- Using source at C:/vcpkg/buildtrees/libtorch/src/8854625dd8-861bd167bd.clean
-- Setting up python virtual environment...
-- Installing python packages: typing-extensions;pyyaml;numpy
-- Setting up python virtual environment... finished.
-- Using Python3: C:/vcpkg/buildtrees/libtorch/x64-windows-venv/Scripts/python.exe
-- Found external ninja('1.11.0').
-- Configuring x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
Command failed: "C:/Program Files/CMake/bin/cmake.exe" C:/vcpkg/buildtrees/libtorch/src/v2.1.2-4fcdc1be04.clean -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=C:/vcpkg/packages/libtorch_x64-windows/debug -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DUSE_DISTRIBUTED=ON -DUSE_ZSTD=ON -DUSE_FFTW=ON -DAT_FFTW_ENABLED=ON -DUSE_FBGEMM=OFF -DUSE_OPENCV=ON -DUSE_LEVELDB=ON -DUSE_OPENCL=OFF -DUSE_CUDA=ON -DUSE_CUDNN=ON -DUSE_NCCL=ON -DUSE_SYSTEM_NCCL=ON -DUSE_NVRTC=ON -DAT_CUDA_ENABLED=ON -DAT_CUDNN_ENABLED=ON -DUSE_MAGMA=ON -DUSE_VULKAN=ON -DUSE_VULKAN_RELAXED_PRECISION=ON -DUSE_ROCM=OFF -DUSE_LLVM=ON -DUSE_MPI=OFF -DUSE_NNPACK=OFF -DAT_NNPACK_ENABLED=OFF -DUSE_XNNPACK=ON -DUSE_QNNPACK=OFF -DBUILD_PYTHON=OFF -DUSE_NUMPY=OFF -DUSE_LIBUV=ON -DUSE_GLOO= -DINTERN_BUILD_MOBILE=OFF -DProtobuf_PROTOC_EXECUTABLE:FILEPATH=C:/vcpkg/installed/x64-windows/tools/protobuf/protoc.exe -DCAFFE2_CUSTOM_PROTOC_EXECUTABLE:FILEPATH=C:/vcpkg/installed/x64-windows/tools/protobuf/protoc.exe -DPYTHON_EXECUTABLE:FILEPATH=C:/vcpkg/buildtrees/libtorch/x64-windows-venv/Scripts/python.exe -DCAFFE2_STATIC_LINK_CUDA=ON -DCAFFE2_USE_MSVC_STATIC_RUNTIME=0 -DBUILD_CUSTOM_PROTOBUF=OFF -DUSE_LITE_PROTO=OFF -DBUILD_TEST=OFF -DATEN_NO_TEST=ON -DUSE_SYSTEM_LIBS=ON -DUSE_METAL=OFF -DUSE_PYTORCH_METAL=OFF -DUSE_PYTORCH_METAL_EXPORT=OFF -DUSE_GFLAGS=ON -DUSE_GLOG=ON -DUSE_LMDB=ON -DUSE_ITT=OFF -DUSE_ROCKSDB=ON -DUSE_OBSERVERS=OFF -DUSE_PYTORCH_QNNPACK=OFF -DUSE_KINETO=OFF -DUSE_ROCM=OFF -DUSE_NUMA=OFF -DUSE_SYSTEM_ONNX=ON -DUSE_SYSTEM_FP16=ON -DUSE_SYSTEM_EIGEN_INSTALL=ON -DUSE_SYSTEM_CPUINFO=ON -DUSE_SYSTEM_PTHREADPOOL=ON -DUSE_SYSTEM_PYBIND11=ON -DUSE_SYSTEM_ZSTD=ON -DUSE_SYSTEM_XNNPACK=ON -DUSE_SYSTEM_GLOO=ON -DUSE_SYSTEM_NCCL=ON -DUSE_SYSTEM_LIBS=ON -DUSE_SYSTEM_FXDIV=ON -DUSE_SYSTEM_SLEEF=ON -DBUILD_JNI= -DUSE_NNAPI= -DUSE_MKLDNN=OFF -DUSE_MKLDNN_CBLAS=OFF -DAT_MKLDNN_ENABLED=OFF -DUSE_OPENCL=ON -DUSE_NUMPY=ON -DUSE_KINETO=OFF "-DCMAKE_MAKE_PROGRAM=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" -DBUILD_SHARED_LIBS=ON -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/vcpkg/scripts/toolchains/windows.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DVCPKG_SET_CHARSET_FLAG=ON -DVCPKG_PLATFORM_TOOLSET=v143 -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON -DVCPKG_APPLOCAL_DEPS=OFF -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON -DVCPKG_CXX_FLAGS= -DVCPKG_CXX_FLAGS_RELEASE= -DVCPKG_CXX_FLAGS_DEBUG= -DVCPKG_C_FLAGS= -DVCPKG_C_FLAGS_RELEASE= -DVCPKG_C_FLAGS_DEBUG= -DVCPKG_CRT_LINKAGE=dynamic -DVCPKG_LINKER_FLAGS= -DVCPKG_LINKER_FLAGS_RELEASE= -DVCPKG_LINKER_FLAGS_DEBUG= -DVCPKG_TARGET_ARCHITECTURE=x64 -DCMAKE_INSTALL_LIBDIR:STRING=lib -DCMAKE_INSTALL_BINDIR:STRING=bin -D_VCPKG_ROOT_DIR=C:/vcpkg -D_VCPKG_INSTALLED_DIR=C:/vcpkg/installed -DVCPKG_MANIFEST_INSTALL=OFF -DPYTHON_LIBRARY=C:/vcpkg/installed/x64-windows/debug/lib/python311_d.lib
Working Directory: C:/vcpkg/buildtrees/libtorch/x64-windows-dbg
Error code: 1
See logs for more information:
C:\vcpkg\buildtrees\libtorch\config-x64-windows-dbg-CMakeCache.txt.log
C:\vcpkg\buildtrees\libtorch\config-x64-windows-dbg-out.log
C:\vcpkg\buildtrees\libtorch\config-x64-windows-dbg-err.log
Call Stack (most recent call first):
installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:267 (vcpkg_execute_required_process)
ports/libtorch/portfile.cmake:140 (vcpkg_cmake_configure)
scripts/ports.cmake:175 (include)
@MonicaLiu0311
The error suggest to simply install pybind
. Probably just a missing dependency but the question is why it requires pybind
may be not config with -DBUILD_PYTHON=OFF -DBUILD_PYTHON=OFF -DUSE_NUMPY=OFF
I had a very similar if not exact error in ...get-pip...
and I fixed it with setting the environment variable PIP_DEFAULT_TIMEOUT=100
and, of course VCPKG_KEEP_ENV_VARS=PIP_DEFAULT_TIMEOUT
. My problem probably had to do with the security controls on our network.
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.
呃,我找到了一个非常有趣的方法来解决这个问题。vcpkg 未准确配置 D:\ProgramData\vcpkg\downloads\tools\python\python-3.11.8-x64 中的 python。并且以下pyton D:\ProgramData \vcpkg \ installed \ x 64-windows\tools \ python3没有问题,所以我将此python复制到
现在,没关系!
神奇,真的可以了😂
Package: libtorch[core,cuda,dist,fftw3,leveldb,llvm,opencv,vulkan,xnnpack,zstd]:x64-windows@2.1.2#1
Host Environment
To Reproduce
vcpkg install libtorch[llvm,vulkan,zstd,leveldb,fftw3,dist,cuda,opencv]:x64-windows openssl:x64-windows openssl:x64-windows-static cppcodec:x64-windows cppcodec:x64-windows-static
Failure logsC:\vcpkg\buildtrees\libtorch\get-pip-x64-windows-err.log
``` Traceback (most recent call last): File "C:\vcpkg\buildtrees\libtorch\src\8854625dd8-861bd167bd.clean\public\get-pip.py", line 33324, in