JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
572 stars 75 forks source link

Blender:Start issues on Windows 10 #31

Closed maybites closed 2 months ago

maybites commented 5 years ago

When trying to start blender via VS Code I get the following error:

blender starts up but crashes after a few seconds:

Executing task: c:\Program Files\Blender Foundation\blender-2.80.0\blender.exe --python c:\Users\maybites.vscode\extensions\jacqueslucke.blender-development-0.0.11\pythonFiles\launch.py <


Read prefs: C:\Users\maybites\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend
found bundled python: c:\Program Files\Blender Foundation\blender-2.80.0\2.80\python
c:\Program Files\Blender Foundation\blender-2.80.0\2.80\python\bin\python.EXE: No module named pip.__main__; 'pip' is a package and cannot be directly executed

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

could not install ptvsd ################################################################################

Saved session recovery to 'C:\Users\maybites\AppData\Local\Temp\quit.blend' The terminal process terminated with exit code: 1

JacquesLucke commented 5 years ago

Can you check if the same problem happens when you use the portable Blender version? (not the installer) Or did you copy Blender into the Program Files folder manually?

Unfortunately, I don't know what causes this error yet.

maybites commented 5 years ago

I installed it manually from the zip

but before I failed with the above issue, I had to set the security access to the python-folder inside the 2.80 folder

I also added the 'pip'-folder inside python/site-packages

strangely on a different win10 machine I was able to make your script work by simply changing the security access to the 'python'-folder. (without adding the pip folder manually).

maybe its a security access issue? I will investigate further..

pwrman64 commented 5 years ago

Got the same issue here.

OlafHaag commented 5 years ago

I just unpacked the blender 2.8 archive into my downloads folder and not into windows' programs folder. Blender starts from VS Code without problems. It installed pip, ptvsd and flask.

markbehm71 commented 5 years ago

Same, @OlafHaag . Having a copy of my blender 2.80.0 directory in my win10 Downloads folder allowed everything to work smoothly without permissions issues. Prior to this I couldn't get it running at work or home no matter what permissions I tried to force on things. I am guessing any public win folder would do it.

postvak commented 5 years ago

I got the same issue. For me it was solved by starting VS Code as administrator.

Zorobay commented 4 years ago

I had the same issue. Can confirm that running VS Code as admin solved the problem 👍

Codelito commented 4 years ago

hey, thank you. running vscode as admin sorted it out.

paulb5352 commented 4 years ago

Running as Admin worked for me as well, thanks Zorobay

Igrium commented 3 years ago

Are you sure running VSCode as admin is a good idea? Given the nature of how it loads 3rd party extensions, that could be a major vulnerability.

markbehm71 commented 3 years ago

Are you sure running VSCode as admin is a good idea? Given the nature of how it loads 3rd party extensions, that could be a major vulnerability.

That was my worry. Dropping a copy/link of whatever Blender vers I need into Documents felt safter. Still working for me.

Igrium commented 3 years ago

That was my worry. Dropping a copy/link of whatever Blender vers I need into Documents felt safter. Still working for me.

How do you do that? My copy is having trouble accessing %appdata%, which is immovable to my knowledge.

markbehm71 commented 3 years ago

That was my worry. Dropping a copy/link of whatever Blender vers I need into Documents felt safter. Still working for me.

How do you do that? My copy is having trouble accessing %appdata%, which is immovable to my knowledge.

Sorry - I mean I have a copy of Program Files/Blender Foundation/blender-2.91 (as well as 2.83) into my Documents folder, which is more permissive folder in Windows. You have to point the VSC plugin prefs to that location. My development folder (actual addons or scripts) is elsewhere - in my case not in my config/ folder. It's location doesn't seem to matter as I believe the plugin is taking care of a linked copy in the appropriate spot.

zNightlord commented 3 years ago

I have the same issue but only for 2.83.12 It was fine for 2.83.9 or 2.83.10 after this happen. But I didn't noticed what really happpened. 2.80, 2.91 run fine. run VSCode as admin or moving the folder elsewhere don't fix the problem.


found bundled python: d:\Blender\blender-2.83-windows64\2.83\python
unknown argument, loading as file: -m
Error: Cannot read file 'd:\Blender\blender-2.83-windows64\-m': No such file or directory
Error: argument has no '.blend' file extension, not using as new file, exiting! d:\Blender\blender-2.83-windows64\-m
Saved session recovery to 'C:\Users\Admin\AppData\Local\Temp\quit.blend'

Blender quit

################################################################################
>   could not install ptvsd
################################################################################

Saved session recovery to 'C:\Users\Admin\AppData\Local\Temp\quit.blend'
The terminal process "d:\Blender\blender-2.83-windows64\blender.exe '--python', 'c:\Users\Admin\.vscode\extensions\jacqueslucke.blender-development-0.0.14\pythonFiles\launch.py'" terminated with exit code: 1.```
3DHerbie commented 3 years ago

I found another solution since running as administrator or changing the directory didnt do the job for me either.

Solution 1 (tested with Blender 2.80rc3 zip extracted, "Program Files/Blender Foundation" folder): Open vs Code Install Blender Development version 0.0.12 Then do "Blender:start" Opened fine with Addon Now change back to version 0.0.14 -> Still working

Solution 2 (tested with Blender 2.80 msi installer, also "Program Files/Blender Foundation" ): Do the same just start vs Code as administrator.

I hope this fixes the issue for other people. Also this should be good information for bugfixing.

Mateusz-Grzelinski commented 2 months ago

closing as ptvsd is no longer used and blender 2.80.34 is pretty old. This isssues will no longer occur after 177 is done