New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: 2.3.0 wheel can not be imported if installed for a single user only #125109
Comments
I have the same problem, I have tried everything
Update : I just installed 2.2.2 and the problem went away |
Here's the full English message to help with searching for the issue: I also have this issue with Python 3.11.9, to complete @DollarAkshay's results. Note that I only use Python, I don't use conda. Would be nice to know which dependency shm.dll is missing, though. |
I can see people on StackOverflow suggesting to use Links: |
Seems high priority given traffic and regression. Marked for triage review. |
Same thing here. Only downgrading to 2.2.2 solved the issue. |
Trying to repro this issue now. We have following validation workflow where windows python 3.12 builds where validated, I do not see this error: |
Further analysis on a test machine using DLLTracer
|
Next update: It works fine when both Python and torch are installed system wide. However, with a system wide Python installing torch in a user context will cause the DLL load error to appear |
@DukeSniper does it work for you if you try creating venv for it https://docs.python.org/3/library/venv.html ? |
I'm seeing this too. It is specific to torch==2.3.0, pip install --user, and WIndows OS. You can see in this github actions run that it is specific to these parameters: https://github.com/RichieHakim/basic_neural_processing_modules/actions/runs/8916263499/job/24487346542#step:11:120 |
Haven't had a chance to try venv yet, but I just tried something else. Installed system wide Python on a naked system, ran "pip install torch torchvision torchaudio & pip uninstall torch" with admin privs, next installed torch as user and it works. Which got me tinkering a bit more. Seeing that the only obvious major change between 2.2.x and 2.3.0 is the additional dependency on |
Aaaand I found the solution. The MKL package, when installed in user context, installs the libraries that shm.dll is linked to into %APPDATA%\Python\Library\Bin - which per default isn't in the PATH env var. Adding that path to the PATH env var allows for the DLL loader to actually find the MKL dlls |
In a self-contained Python install, libraries installed in APPDATA are problematic, But the good news is, the DLLs can be found in UPDATE: I tried with adding the torch/lib path to both the PATH environment variable and PythonPath, it didn't work for me. I'm not sure why it worked with @DukeSniper, it may be because of my particular setup (PythonNet and a self-contained Python install). I'll wait for feedback from the PyTorch team. |
There is multiple .dll files which
|
Looks like the issue was introduced by these PR's: Most likely the problem that
The variable that needs to be added to a PATH is the
As per this comment: #125109 (comment) However we should already be loading dlls from this path. here is the logic for it: This problem is specific when Python is installed systemwide while torch is installed in user context. In this case the mkl libraries are installed in default path:
|
馃悰 Describe the bug
Upgrading torch from a perfectly fine 2.2.2 to 2.3.0 seems to break it on Windows
Versions
Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A
OS: Microsoft Windows 10 Enterprise LTSC
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A
Python version: 3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.19044-SP0
Is CUDA available: N/A
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4070 SUPER
Nvidia driver version: 551.86
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A
CPU:
Architecture=9
CurrentClockSpeed=3401
DeviceID=CPU0
Family=107
L2CacheSize=8192
L2CacheSpeed=
Manufacturer=AuthenticAMD
MaxClockSpeed=3401
Name=AMD Ryzen 9 5950X 16-Core Processor
ProcessorType=3
Revision=8450
Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] torch==2.3.0
[pip3] torchaudio==2.3.0
[pip3] torchsde==0.2.6
[pip3] torchvision==0.18.0
[conda] Could not collect
cc @ezyang @gchanan @zou3519 @kadeng @msaroufim @seemethere @malfet @osalpekar @atalman @peterjc123 @mszhanyi @skyline75489 @nbcsm @vladimir-aubrecht @iremyux @Blackhex @cristianPanaite
The text was updated successfully, but these errors were encountered: