Code Monkey home page Code Monkey logo

Comments (15)

prehensile avatar prehensile commented on June 5, 2024 1

I had the same problem and can confirm that the fix from #31 works.

I've put together a slightly more repeatable / durable solution for now:

  • Install Python 3.8 from https://www.python.org/downloads/windows/
    -- I chose to install for all users, becauase the idea of having a whole Python install in my user directory feels untidy to me. In reality, it probably doesn't make any difference where you install it.
  • Place the attached .bat file in your Bespoke Synth install directory, probably C:\Program Files\BespokeSynth (rename from .bat.txt to .bat): launcher.bat.txt
  • You'll probably need to edit the .bat file to reflect your Python install location
  • Edit the shortcut to Bespoke Synth in your Start Menu (right click -> properties) to point to launcher.bat instead of BespokeSynth.exe (in the same directory)
  • (Optional) Edit the shortcut's icon to use BespokeSynth.exe to get the nice icon back :)

Now your start menu entry sets up the correct PYTHONHOME variable every time!

from bespokesynth.

awwbees avatar awwbees commented on June 5, 2024 1

this is a good suggestion, I will look into it

from bespokesynth.

dospunk avatar dospunk commented on June 5, 2024

Here's the error message:

 Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'C:\\Users\\MyUser\\Desktop\\Bespoke Synth\\BespokeSynth.exe'
  sys.base_prefix = ''
  sys.base_exec_prefix = ''
  sys.executable = 'C:\\Users\\MyUser\\Desktop\\Bespoke Synth\\BespokeSynth.exe'
  sys.prefix = ''
  sys.exec_prefix = ''
  sys.path = [
    'C:\\Users\\MyUser\\Desktop\\Bespoke Synth\\python38.zip',
    '.\\DLLs',
    '.\\lib',
    'C:\\Users\\MyUser\\Desktop\\Bespoke Synth',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00000760 (most recent call first):
<no Python frame>

from bespokesynth.

awwbees avatar awwbees commented on June 5, 2024

I should definitely make this not crash, and give a good error message, but I'd guess this might be caused by an issue with your python install. do you have python installed? to confirm for you, the script module works for me in both windows 10 and macOS.

from bespokesynth.

dospunk avatar dospunk commented on June 5, 2024

Yes, I have Python 3.9.0 installed

from bespokesynth.

awwbees avatar awwbees commented on June 5, 2024

thank you for confirming! these machine config bugs are so tricky to debug/repro. does this workaround fix the crash for you? https://github.com/awwbees/BespokeSynth/issues/31

I still need to figure out the real fix, and why it's only a problem for some users

from bespokesynth.

enchilada404 avatar enchilada404 commented on June 5, 2024

Have you made any progress on this?

Would love to see the script module working on windows 10/python 3.9... 🙏

from bespokesynth.

awwbees avatar awwbees commented on June 5, 2024

I have not made progress, I'm not yet sure if it's possible to support multiple versions of python simultaneously, and it is not a high priority for me since python 3.8 is functioning fine. have you tried with python 3.8? that should work. here's a much more recent build to try: https://www.dropbox.com/s/5mqkzefw4mubdcx/Bespoke-Windows-20200726.zip?dl=1

is there any specific reason you'd prefer to use python 3.9 over 3.8?

from bespokesynth.

dromer avatar dromer commented on June 5, 2024

The best solution would be to embed python more directly and link to an interpreter statically.

from bespokesynth.

j-red avatar j-red commented on June 5, 2024

I was able to resolve this issue with the workaround from #31 by installing Python 3.8.10 to the default install location and entering set PYTHONHOME=C:\Users\<your user>\AppData\Local\Programs\Python\Python38 into the Command Prompt. Now scripts work like a charm!

from bespokesynth.

prehensile avatar prehensile commented on June 5, 2024

A suggestion for what might be a low-effort fix in Bespoke itself: a setting in the config menu which would allow the user to set a string for the PYTHONHOME var, which could then hopefully be passed to pybind on init? I had a quick poke at the pybind source to see if there was anything immediately obvious, but I'm not a C++ programmer so it went way over my head.

This suggested fix might be useful on other platforms, too, if folks have system versions of Python installed that aren't 3.8

from bespokesynth.

prehensile avatar prehensile commented on June 5, 2024

A slightly more hacky, but would probably work, version of the above would be to set the env var from Bespoke before initing pybind.

from bespokesynth.

prehensile avatar prehensile commented on June 5, 2024

Aha! I can't see any obvious way to set PYTHONHOME in pybind, but you can set it by calling Py_SetPythonHome directly in the Python C API; there's some example code in this pybind issue here: pybind/pybind11#2369 (which I can see you've already come across, @awwbees). Thanks for the awesome software!

from bespokesynth.

yhancik avatar yhancik commented on June 5, 2024

The PYTHONHOME fix works for me too. I'd like to add that if you're using Powershell instead of the old Command Prompt (and I think it's the default on Windows nowadays?), you have to set PYTHONHOME with
$Env:PYTHONHOME="C:/path/to/your/python3.8/install"

from bespokesynth.

awwbees avatar awwbees commented on June 5, 2024

should be all set now that bespoke includes its own python

from bespokesynth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.