Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: process didn't exit successfully: target\debug\cpythontest3.exe (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND) #286

Open
ninetynin opened this issue Oct 24, 2022 · 4 comments

Comments

@ninetynin
Copy link

image

This must be a dumb doubt for sure
Im asking here atlast after I coudnt find solution anywhere... I'm intermediate in python and completed until chapter 5 in rust
Im trying to use python in rust while using the example i couldnt find out how to solve this...
image
Maybe its this because I didnt know how to do this step i checked out py03 example which suggests just installing python in ubuntu but nothing about in windows and while i just tested installing python using wsl it quite didnt work thats why

@ssokolow
Copy link

ssokolow commented Oct 24, 2022

i checked out py03 example which suggests just installing python in ubuntu but nothing about in windows and while i just tested installing python using wsl it quite didnt work thats why

Did you install Rust for Windows or WSL? I imagine that PyO3 will want the WSL version of Python when you're running Rust inside WSL and the Windows version of Python when you're running Rust outside of WSL.

Your cpythontest3.exe suggests you're running for a non-WSL target, so you need a non-WSL Python.

@ninetynin
Copy link
Author

i checked out py03 example which suggests just installing python in ubuntu but nothing about in windows and while i just tested installing python using wsl it quite didnt work thats why

Did you install Rust for Windows or WSL? I imagine that PyO3 will want the WSL version of Python when you're running Rust inside WSL and the Windows version of Python when you're running Rust outside of WSL.

Your cpythontest3.exe suggests you're running for a non-WSL target, so you need a non-WSL Python.

Hey ssokolow I have all rust tools & python installed in both wsl and windows..//
and the error im showing here is while using windows powershell ie windows and actually what i was actually confused about is i have python in installed in windows from beginning so i didnt install any specific tools so like do i need to have some other executable or something?

@dgrunwald
Copy link
Owner

The error indicates that cpythontest3.exe cannot find python3x.dll (where x depends on the python version used at build time, which for rust-cpython you can control with PYTHON_SYS_EXECUTABLE).

Window searches for required libraries only in the application directory, PATH and the windows system directory. Unlike Linux, there is no concept of a RUNPATH stored in the executable (which is how the python library gets found on Linux).
So unless you copy your executable into the same directory as your python installation, the only way to get it running is to add your python installation to the PATH.

@ninetynin
Copy link
Author

The error indicates that cpythontest3.exe cannot find python3x.dll (where x depends on the python version used at build time, which for rust-cpython you can control with PYTHON_SYS_EXECUTABLE).

Window searches for required libraries only in the application directory, PATH and the windows system directory. Unlike Linux, there is no concept of a RUNPATH stored in the executable (which is how the python library gets found on Linux). So unless you copy your executable into the same directory as your python installation, the only way to get it running is to add your python installation to the PATH.

Hey i didnt get what u mean exactly...
Like are u saying we need to copy the .exe present in the below pic to python installation folder in windows?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants