Open 14sirs opened 2 weeks ago
hmm... I can't quite judge from the screenshot, but I suppose with numpy in the imports, dolphin just freezes, correct?
hmm... I can't quite judge from the screenshot, but I suppose with numpy in the imports, dolphin just freezes, correct?
hmm... I can't quite judge from the screenshot, but I suppose with numpy in the imports, dolphin just freezes, correct?
@Felk Kind of - it more refuses to run any code as soon as I import numpy - Dolphin itself will still run, but the code input just stops working when trying to import numpy. I've tried using sys to append my normal python running directory, but I still get the same error.
@Felk I have just thought that it might be because numpy isn't installed to dolphin, but my PC's version of python312. It has also come with stubs in the IDE I am using, and it errors when trying to find these stubs. Would there be a way to install it into the fork of dolphin itself, and if so how? (I've tried using pip to install it to the python312.zip folder, but this just enters the folder instead of installing it)
Ahh, yes you're partially right. The problem is most likely that it just doesn't find numpy. If you open a console as described in the readme you should be able to confirm that it's just an ImportError.
As for how to fix that: you can't install numpy "into" dolphin, but you can extend the search path so the embedded dolphin also finds your system installed libraries:
Please see the snippet regarding "sys.path.append" here: https://github.com/Felk/dolphin/issues/9#issue-1044175969
@Felk I have tried doing the sys.path.append(site-packages), and that still yields an error in the dolphin log(as shown below). When I don't use sys, it just says numpy not found
Here is the error I get when using sys:
I've tried the thing that it says to fix the issue, but that didn't work. The thing it is failing to import comes from my python-stubs when I import it in my IDE
Yip, although the source code is updated for Python 3.12, the binary I shipped (preview 3) has python 3.11 embedded. Please either building felk/dolphin from source, or install python 3.11 locally. Then install numpy there and append the python 3.11 path. Hope that helps.
Hold on, judging from the screenshot your copy of dolphin already has python 3.12. did you already build from source?
Hold on, judging from the screenshot your copy of dolphin already has python 3.12. did you already build from source?
Yes, I have built the solution files in the dolphin location after cloning it, as it said to do
For some reason the version that dolphin is installed with is a python312.zip. I did not add this myself. I have tried reinstalling and rebuilding dolphin too, but that still gives python312. (The "attempts" were where I was trying to add numpy to it)
I used git clone https://github.com/Felk/dolphin.git
in command prompt in a folder where I wanted to install it to, and then built the solution file in dolphin\source
using Visual Studio 2022
I have also tried reinstalling dolphin, and also tried it on a different device, but still get the same error @Felk
@Felk here is a video I created of how dolphin runs on my device, and what happens when I try to import numpy: https://youtu.be/gQKiAqVstgw (The current device I am using is quite slow, but dolphin does continue running when the code errors.)
Thanks for the patience. I'll have to take a deeper look sometime soon. I hope to catch some motivation next week, but no promises. As for what steps you've done so far, it seems you did everything right and it's indeed an issue with the python Integration. Sorry for the problems
Thanks for the patience. I'll have to take a deeper look sometime soon. I hope to catch some motivation next week, but no promises. As for what steps you've done so far, it seems you did everything right and it's indeed an issue with the python Integration. Sorry for the problems
Ok, thank you. Do you have any temporary work-arounds that you know of?
You can try Scripting-Preview 3 and python 3.11 instead. It used to work in the past, so you might have luck with older builds
You can try Scripting-Preview 3 and python 3.11 instead. It used to work in the past, so you might have luck with older builds
I've been looking for it, but can't seem to find Scripting-preview 3. Is it on the github somewhere, or does it come installed when I cloned the repo?
It's in the GitHub repo under tags/releases. Here's a link for you: https://github.com/Felk/dolphin/releases good luck!
Ok, I'll try cloning that version, I'll let you know if it works for me
Slight issue when Building the scripting-preview3 - I am getting this error 704 times, each for a different part Here was what I used to clone the scripting-preview3: git clone https://github.com/Felk/dolphin.git --branch scripting-preview3
All of the errors seem to be from not being able to find this "pch.pch" file- there is a file called pch in the location it is trying, but it is a text file instead
Please try the precompiled executable that's available for download before trying to build it yourself
I believe the version I got from here "https://github.com/Felk/dolphin/releases" (in the assets - "dolphin-scripting-preview3-x64.7z") is working with numpy - thank you for suggesting this! - this version is the one where dolphin hangs itself if you don't use --no-python-subinterpreters in command line
The older version also runs a lot quicker and smoother for some reason @Felk
I have used the command line option --no-python-subinterpreters, as was suggested in order to get numpy to work, but it still ends up breaking the code. Below shows the code I am running and what happens with and without importing numpy Without Numpy: With Numpy: