我想使用 Jetbrains Gateway 通过 ssh 连接到我的服务器,当我在 ubuntu 服务器上安装 jetbrains PyCharm 客户端时,我遇到了同样的错误:
Details:
An error occurred while executing command: 'get-jstack --ide-path=/root/.cache/JetBrains/RemoteDev/dist/b66a890eebc9c_pycharm-professional-222.4167.4 --project-path=/dev'
Exit code: 1
Run Code Online (Sandbox Code Playgroud)
我尝试运行命令:
get-jstack --ide-path=/root/.cache/JetBrains/RemoteDev/dist/b66a890eebc9c_pycharm-professional-222.4167.4 --project-path=/dev
Run Code Online (Sandbox Code Playgroud)
并有错误:
-bash: get-jstack: command not found
Run Code Online (Sandbox Code Playgroud)
如何安装get-jstack?
我有一个 FastAPI 应用程序,我需要创建一个 Car 类,其中属性Wheel和speed可以采用 int或str 类型。怎么做?此代码不起作用,因为Wheel和speed将只有整数类型(第二次打印中不是 str ):
from pydantic import BaseModel
class Car(BaseModel):
wheel: int | str
speed: int | str
bmw = Car(wheel=4, speed=250)
mercedes = Car(wheel='4', speed='200')
print(type(bmw.wheel), type(bmw.speed))
print(type(mercedes.wheel), type(mercedes.speed))
Run Code Online (Sandbox Code Playgroud)
结果是:
<class 'int'> <class 'int'>
<class 'int'> <class 'int'>
Run Code Online (Sandbox Code Playgroud)