JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
540 stars 70 forks source link

Not working in Blender 3.6 #148

Closed LorenzWieseke closed 9 months ago

LorenzWieseke commented 9 months ago

Everything works fine in previews Blender versions but in 3.6, when I start "Build and Run" I get an error related to debugpy not having a listen function.

I tried installing debugpy with pip but I actually have no idea what debugpy has to do with the blender version.

Traceback (most recent call last): File "c:\Users\wiese.vscode\extensions\jacqueslucke.blender-development-0.0.18\pythonFiles\launch.py", line 14, in blender_vscode.startup( File "c:\Users\wiese.vscode\extensions\jacqueslucke.blender-development-0.0.18\pythonFiles\include\blender_vscode__init__.py", line 17, in startup communication.setup(editor_address, path_mappings) File "c:\Users\wiese.vscode\extensions\jacqueslucke.blender-development-0.0.18\pythonFiles\include\blender_vscode\communication.py", line 21, in setup DEBUGPY_PORT = start_debug_server() File "c:\Users\wiese.vscode\extensions\jacqueslucke.blender-development-0.0.18\pythonFiles\include\blender_vscode\communication.py", line 53, in start_debug_server debugpy.listen(("localhost", port)) AttributeError: module 'debugpy' has no attribute 'listen'

CGArtPython commented 9 months ago

Hello,

I'm using this extension with Blender 3.6, and I'm not hitting this.

In the scripting workspace, in the interactive python console, what does this print ?

>>> import debugpy
>>> debugpy.__version__

and this

>>> dir(debugpy)
LorenzWieseke commented 9 months ago
>>> import debugpy
>>> debugpy.__version__
Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\python\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<blender_console>", line 1, in <module>
AttributeError: module 'debugpy' has no attribute '__version__'

>>> dir(debugpy)
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
CGArtPython commented 9 months ago

please ignore the closed attempt, I fat-fingered it

It seems that something is wrong with your debugpy install.

I have this

>>> import debugpy
>>> debugpy.__version__
'1.6.6'
>>> dir(debugpy)
['Endpoint', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_version', 'annotations', 'breakpoint', 'configure', 'connect', 'debug_this_thread', 'functools', 'is_client_connected', 'listen', 'log_to', 'public_api', 'trace_this_thread', 'typing', 'wait_for_client']

Are you using this pip install debugpy to install it? https://pypi.org/project/debugpy/

I would uninstall and install it once again. Make sure that the Python folder in Blender's install location is writable.

If this does not work - try getting a portable version of Blender and install debugpy into that and try again.

LorenzWieseke commented 9 months ago

Thanks a lot! I downloaded the portable version and copied it to my program files. Now everything works like a charm. Must have been permissions, but I wonder why Blender 3.5 worked (same way of installing, same permissions / write access) Anyway, thanks again.

CGArtPython commented 9 months ago

I'm happy to hear that you are up and running 🥳

I explain how you can fix the permissions issue here https://youtu.be/YUytEtaVrrc?t=520

I'm still not 100% sure that you had exactly the same permissions issue.