blender_vscode icon indicating copy to clipboard operation
blender_vscode copied to clipboard

Version 0.0.15 could not install debugpy

Open paulb5352 opened this issue 3 years ago • 16 comments

Version 0.0.14 works perfectly OK. After upgrading to 0.0.15 and issuing the Blender: Start command I now get

Executing task: c:\Program Files\Blender Foundation\Blender 2.90\blender.exe --python c:\Users\Paul Brassington.vscode\extensions\jacqueslucke.blender-development-0.0.15\pythonFiles\launch.py <

Read prefs: C:\Users\Paul Brassington\AppData\Roaming\Blender Foundation\Blender\2.90\config\userpref.blend found bundled python: c:\Program Files\Blender Foundation\Blender 2.90\2.90\python [{'load_dir': 'c:\Users\Paul Brassington\Documents\Code\Blender\PBB', 'module_name': 'PBB'}] Read prefs: C:\Users\Paul Brassington\AppData\Roaming\Blender Foundation\Blender\2.90\config\userpref.blend found bundled python: c:\Program Files\Blender Foundation\Blender 2.90\2.90\python unknown argument, loading as file: -m Error: Cannot read file 'c:\Program Files\Blender Foundation\Blender 2.90-m': No such file or directory Error: argument has no '.blend' file extension, not using as new file, exiting! c:\Program Files\Blender Foundation\Blender 2.90-m Saved session recovery to 'C:\Users\PAULBR~1\AppData\Local\Temp\quit.blend'

Blender quit

################################################################################

could not install debugpy ################################################################################

Saved session recovery to 'C:\Users\PAULBR~1\AppData\Local\Temp\quit.blend'

paulb5352 avatar May 13 '21 15:05 paulb5352

The extension probably installed ptvsd some time ago for you and since then it was working. The problem is that ptvsd was deprecated and caused some issues. You could try:

  • Install debugpy in Blender manually.
  • Use a portable (not an installed) version of Blender. That might allow the extension to install the python module without additional rights.
  • Start vscode as administrator when using the extension the first time. (Note, you don't need to start vscode as administrator once debugpy has been installed.)

JacquesLucke avatar May 14 '21 08:05 JacquesLucke

After following the steps and start vscode as administrator I get the following time out:

image

jacastillol-bairesdev avatar May 14 '21 10:05 jacastillol-bairesdev

Having this issue as well.

nmarchuk avatar May 14 '21 18:05 nmarchuk

Same for me. After I install debugpy to blender python it asks for flask, so I install flask too and then I get error as @jacastillol-bairesdev mentions. Blender version 2.83 LTS.

Griperis avatar May 14 '21 21:05 Griperis

I think this blender extension only works for Blender 2.92 now.

But I'm not sure why that is. I have tested it with 2.80 and 2.83 now, but receiving this "timeout" error as well.

2.92 is working though. So the README.md needs to be adapted.

RobertHue avatar May 22 '21 17:05 RobertHue

This issue is related to #96 and #95.

RobertHue avatar May 24 '21 10:05 RobertHue

As mentioned in #96 the reason for the failure is that All Blender versions before Blender 2.92 have the environment variable sys.executable wrongly pointing to the Blender executable instead of the Python executable. But debugpy uses the environment variable for its own purposes, hence things go very wrong when the debug client tries to connect to the debug server by using blender.exe as the python engine :)

So, this Blender Development plugin 0.0.15 only works on Blender 2.92 and newer, while 0.0.14 only works on older Blender versions. As long as there is no significant change in the plugin i believe its best to install 0.0.14 when you work with older blender versions.

gaiaclary avatar May 24 '21 11:05 gaiaclary

I uninstalled "Blender Development 0.0.15" extension in VS Code. Then installed "Blender Development 0.0.14" extension which I downloaded from here [[https://marketplace.visualstudio.com/items?itemName=JacquesLucke.blender-development]]. Now, I am not facing this issue anymore.

KhyatiSethia avatar May 25 '21 09:05 KhyatiSethia

Neither 0.0.15 nor 0.0.16 seem to work out of the box with 2.93. Same error message as the OP about debugpy in both cases. I tried installing debugpy, and the error messaged complained about Flask instead. So, I installed flask as well through Blender's console.

Now I'm getting a permission error on the AppData/Roaming/Blender/2.93/scripts/addons/[name-of-the-addon] directory, despite running VSCode with administrative privileges.

I am getting the correct behavior on 0.0.15 and 0.0.16 for Blender 2.91, however. Was there ever a resolution to this, that would work with the current version of Blender?

AcylSilane avatar Jul 26 '21 02:07 AcylSilane

@AcylSilane Yes, it is possible to get 2.91 and greater working by manually installing each of the python modules in an Adminstrator's console.

&'c:\Program Files\Blender Foundation\Blender 2.93\2.93\python\bin\python.EXE' -m pip install debugpy click flask

There may be some other modules that need escalated privilege.

shogerr avatar Sep 01 '21 06:09 shogerr

As @JacquesLucke mentioned, starting vscode as administrator when using the extension the first time solved the issue for me. It's a privilege problem.

nypam avatar Oct 16 '21 17:10 nypam

I was unable to get this solved with elevated privileges in VS Code - I assume it may be because Blender doesn't launch with elevated privileges.

However, if you look at the console output when attempting to start the app, it will give the directory it's trying to copy the Python files from and to after downloading them with pip. If you just manually copy those directories, everything will work fine.

On Windows 10, I just used command line with admin privileges and XCODE with the the appropriate switches (/E and /H I think?) to recursively copy the plugin directories to where the app wanted them. Everything worked fine thereafter.

Jantolick avatar Jan 22 '22 17:01 Jantolick

I am having this problem again in Blender 3.1.0

Traceback (most recent call last):
  File "/home/flo/.vscode/extensions/jacqueslucke.blender-development-0.0.16/pythonFiles/include/blender_vscode/external/get-pip.py", line 20890, in <module>
    main()
  File "/home/flo/.vscode/extensions/jacqueslucke.blender-development-0.0.16/pythonFiles/include/blender_vscode/external/get-pip.py", line 197, in main
    bootstrap(tmpdir=tmpdir)
  File "/home/flo/.vscode/extensions/jacqueslucke.blender-development-0.0.16/pythonFiles/include/blender_vscode/external/get-pip.py", line 82, in bootstrap
    import pip._internal

ImportError: cannot import name 'Mapping' from 'collections' (/home/flo/Documents/software/blender-3.1.0-linux-x64/3.1/python/lib/python3.10/collections/__init__.py)
/home/flo/Documents/software/blender-3.1.0-linux-x64/3.1/python/bin/python3.10: No module named pip

################################################################################
>   could not install debugpy
################################################################################

flolu avatar Mar 12 '22 12:03 flolu

I fixed the problem by running

./blender-3.1.0-linux-x64/3.1/python/bin/python3.10 -m ensurepip

flolu avatar Mar 12 '22 12:03 flolu

Testing here with Windows x64 Blender Development v0.0.16 Blender 3.0.1

last error reads:

PermissionError: [WinError 5] Access is denied: 'c:\\Program Files\\Blender Foundation\\Blender 3.0\\3.0\\python\\lib\\site-packages\\debugpy'

Then tried:

  • Running VSCode with administrator privileges
  • Manually installed requirements with "c:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.EXE" -m pip install debugpy click flask

Now it works (also after restarting VSCode without admin). Probably didn't need the admin privileges since installed from command line. Also simply running as admin didn't work (needed to manually install those bits from command line)

When i try with Blender 2.93.5 it also works (following same steps).

elliotwoods avatar Mar 12 '22 14:03 elliotwoods

Same issue Windows 10, Blender Development 0.0.16 Blender 3.0.0

  • Running VSCode as admin didn't help.
  • Manually copying (as per @Jantolick suggestion) didn't work because the temp folder wasn't there.
  • Using 0.0.14 seems to have incompatibility issue.
  • @elliotwoods I tried manually installing requirements but for me it says Defaulting to user installation because normal site-packages is not writeable and installs packages for the wrong Python executable. Did you also have that?

UPD: the only thing that helped is to use the portable version of the Blender. Well, that's the way it is :)

kirdaybov avatar Apr 25 '22 21:04 kirdaybov