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

mxvscode-autodesk seems not work #38

Open
lifeyf opened this issue Oct 4, 2023 · 2 comments
Open

mxvscode-autodesk seems not work #38

lifeyf opened this issue Oct 4, 2023 · 2 comments

Comments

@lifeyf
Copy link

lifeyf commented Oct 4, 2023

after cd in max install dir[3dsmax 2022], and "D:/project/3dsMax-Python-HowTos/install.sh",every thing seems right until I start 3dsmax :

mxvscode startup enabling vscode debugging
(if you don't use VSCode for debugging Python you can uninstall
mxvscode)
skipped package startup for mxvscode-autodesk 0.0.1, startup not working

Expecially, the pip cant update, very confused because I have used a newer version of python, where can i start pip ,python. ## can you please just set it into 3dsmax--- the cmd and the console.

i am a artist, not a programmer ,umm , this is really not easy to me.

then I just open the script run it in 3dsmax:

import sys
import os
import debugpy

sysexec = sys.executable
(base, file) = os.path.split(sys.executable)

if file.lower() == "3dsmax.exe":
	sys.executable = os.path.join(base, "python", "python.exe")
host = "localhost"
port = 5678
debugpy.listen((host, port))
print(f"-- now ready to receive debugging connections from vscode on (${host}, ${port})")
sys.executable = sysexec
### output:
Traceback (most recent call last):
  File "<input>", line 12
  File "C:\Users\xxx\AppData\Roaming\Python\Python37\site-packages\debugpy\public_api.py", line 31, in 'wrapper' function
  File "C:\Users\xxx\AppData\Roaming\Python\Python37\site-packages\debugpy\server\api.py", line 143, in 'debug' function
  File "C:\Users\xxx\AppData\Roaming\Python\Python37\site-packages\debugpy\server\api.py", line 141, in 'debug' function
  File "C:\Users\xxx\AppData\Roaming\Python\Python37\site-packages\debugpy\server\api.py", line 234, in 'listen' function
RuntimeError: error spawning debug adapter: [WinError 2] The system cannot find the file specified
@hugow
Copy link
Collaborator

hugow commented Oct 5, 2023

I will try it in 2022.

@hugow
Copy link
Collaborator

hugow commented Oct 5, 2023

I just tried in 2022 and it worked for me. Is it possible that you don't have VStudio on your machine (just guessing after reading this https://stackoverflow.com/questions/71342354/failed-to-launch-debug-adapter-in-visual-studio-2022)? If it's the case and you don't want to remote debug python in 3dsMax (using VStudio) just ignore.

Other, just in case. On my fresh 2022 install, when I do:

cd /c/Program Files/Autodesk/3ds Max 2022/python37

and then

./python -m pip show debugpy

I see:

Name: debugpy
Version: 1.7.0
Summary: An implementation of the Debug Adapter Protocol for Python
Home-page: https://aka.ms/debugpy
Author: Microsoft Corporation
Author-email: [email protected]
License: MIT
Location: c:\users\windishadmin\appdata\roaming\python\python37\site-packages
Requires:
Required-by: mxvscode-autodesk

So my version of this is 1.7.0

maybe if it's not the case on your side you could try reinstalling debugpy

./python -m pip install --user --upgrade --force-reinstall debugpy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants