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

Blender with Anaconda environment error on Blender:Start #113

Open
Failxxx opened this issue Jan 20, 2022 · 2 comments
Open

Blender with Anaconda environment error on Blender:Start #113

Failxxx opened this issue Jan 20, 2022 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@Failxxx
Copy link

Failxxx commented Jan 20, 2022

I recently installed Blender 3.0. I have chosen to use an anaconda environment in order to install python packages which would then be available in Blender. I have correctly linked the python folder of my anaconda env here: C:\Program Files\Blender Foundation\Blender 3.0\3.0. If I launch blender from the anaconda prompt, everything is working fine.
However, when I use the Blender:Start command in VSCode, I have the following error message:

Read prefs: C:\Users\felix\AppData\Roaming\Blender Foundation\Blender\3.0\config\userpref.blend
Unable to find the python binary, the multiprocessing module may not be functional!
[{'load_dir': 'c:\\Users\\felix\\Documents\\IMAC\\quantum_nodes\\quantum_nodes', 'module_name': 'quantum_nodes'}]
Traceback (most recent call last):
  File "c:\Users\felix\.vscode\extensions\jacqueslucke.blender-development-0.0.16\pythonFiles\launch.py", line 14, in <module>
    blender_vscode.startup(
  File "c:\Users\felix\.vscode\extensions\jacqueslucke.blender-development-0.0.16\pythonFiles\include\blender_vscode\__init__.py", line 8, in startup     
    from . import installation
  File "c:\Users\felix\.vscode\extensions\jacqueslucke.blender-development-0.0.16\pythonFiles\include\blender_vscode\installation.py", line 7, in <module>
    from . environment import python_path, use_own_python
  File "c:\Users\felix\.vscode\extensions\jacqueslucke.blender-development-0.0.16\pythonFiles\include\blender_vscode\environment.py", line 6, in <module> 
    python_path = Path(sys.executable)
  File "c:\Program Files\Blender Foundation\Blender 3.0\3.0\python\lib\pathlib.py", line 1082, in __new__
    self = cls._from_parts(args, init=False)
  File "c:\Program Files\Blender Foundation\Blender 3.0\3.0\python\lib\pathlib.py", line 707, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "c:\Program Files\Blender Foundation\Blender 3.0\3.0\python\lib\pathlib.py", line 691, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Saved session recovery to 'C:\Users\felix\AppData\Local\Temp\quit.blend'

Terminal will be reused by tasks, press any key to close it.

The second line of the message (Unable to find the python binary, the multiprocessing module may not be functional!) is strange because it does not appear when I launch Blender through the anaconda prompt. I think the issue could come from here, so I tried to set up some environment variables in the Path (in my Windows parameters) variable, but it does not do anything.
Has anyone already faced this issue?

@Mateusz-Grzelinski Mateusz-Grzelinski added help wanted Extra attention is needed question Further information is requested labels Aug 11, 2024
@Mateusz-Grzelinski
Copy link
Collaborator

logic for finding python was changed relatively revently. Try newest blender.
Otherwise I recommend this nice lecture: https://projects.blender.org/blender/blender/src/branch/main/source/blender/python/intern/bpy_interface.cc#L438

@Mateusz-Grzelinski
Copy link
Collaborator

Mateusz-Grzelinski commented Aug 11, 2024

oh, wait, this error is on our part. This is very weird scenario, our logic might not handle it well. Try

  1. newest extension from store
  2. extension from master branch

Otherwise I need from you to tell me how do I find python interpreter path when using anaconda & blender. Usually one of those work:

getattr(bpy.app, "binary_path_python")
sys.executable
bpy.app.binary_path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants