推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
JerningChan
V2EX  ›  Python

请教个 pycharm 远程调试代码的问题

  •  
  •   JerningChan · Oct 12, 2021 · 4590 views
    This topic created in 1864 days ago, the information mentioned may be changed or developed.
    大家好,我目前有个工作环境,是接手别人的,架构呢,暂时不能改动

    1,上手原来的代码和其他 mssql 服务都是放在 win2012 上边运行的,然后他是直接远程桌面上去调试代码的
    2,我日常工作环境是 mac,我自己的项目都是在 centos7 跑的,所以我很多时候都是 pycharm 远程去调试服务器的代码

    但是对于 win2012 才能用 pycharm 远程调试呢?

    我现在还有个啧中的办法就是,本地写好了,把整个文件 cp 进去。。。再运行,但是觉得实在是不方便,而且远程桌面修改代码,也实在不太爽快
    16 replies  •  2021-10-14 17:08:16 +08:00
    UN2758
    UN2758
    Oct 12, 2021
    1
    你在 win 服务器上装个 ssh,pycharm 里配置远程解释器就行了吧
    KallyDev
    KallyDev
    Oct 12, 2021 via iPhone
    2
    要是 Linux 服务器还能通过 Remote SSH 进行调试,Windows Server 版本太低确实不太方便。不过手动 copy 也太麻烦了吧,公司内部没有 Git 服务器吗?

    git commit && git push
    git pull
    tjx20114
    tjx20114
    Oct 13, 2021
    3
    专业版可以用,
    tjx20114
    tjx20114
    Oct 13, 2021
    4
    1. deployment
    https://www.jetbrains.com/help/pycharm/tutorial-deployment-in-product.html#deployment-tools
    ctrl+s 保存自动上传服务器
    2. 配置远程解释器
    JerningChan
    JerningChan
    OP
    Oct 13, 2021
    5
    @UN2758 嗯,正打算,实在没其他办法就弄这个,不过话说那个 win 系统的 github openssh 服务,好像还是 bate 版?
    @KallyDev 没呢。。。还在用 svn
    @tjx20114 哦?好的,谢谢大佬,明天看看这个
    UN2758
    UN2758
    Oct 13, 2021
    6
    @JerningChan #5 2021 版的没有实际用过,之前遇到的场景都是 win 本地连接到远程 linux
    UN2758
    UN2758
    Oct 13, 2021
    7
    2012
    ufo22940268
    ufo22940268
    Oct 13, 2021
    8
    能访问远端的调试的端口就能远程调试,具体[教程]( https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config)
    smallX
    smallX
    Oct 13, 2021
    9
    服务器是 win, 好骚...
    JerningChan
    JerningChan
    OP
    Oct 13, 2021
    10
    @smallX 是啊,没办法,他们弄那些什么国产软件。。。然后非得用 winserver

    @UN2758 按正常情况都是应该这样的。。。然而。。。没办法😂

    @ufo22940268 哦,好的,谢谢 dalao
    JerningChan
    JerningChan
    OP
    Oct 14, 2021
    11
    @UN2758 win2012 安装 openssh 然后配置远程解释器不太行,好像有 bug
    我用的 pycharm 2021.1.3
    但是配置 远程目录是可以上传下载的
    目前暂时只能 本地写好,上传,然后 ssh 来运行了
    UN2758
    UN2758
    Oct 14, 2021
    12
    你配置远程解释器在哪一步失败了?正常的 ssh 能连上服务器吗? sftp 看样子是可以用
    JerningChan
    JerningChan
    OP
    Oct 14, 2021
    13
    @UN2758 肯定可以连上的,就是填那个 python 路径时
    1,按 win 的写法,就找不到路径

    2,按 linux 的写法,就提示出错

    https://imgur.com/a/tez8Sdh
    UN2758
    UN2758
    Oct 14, 2021
    14
    @JerningChan #13 https://www.jetbrains.com/help/pycharm/configuring-remote-interpreters-via-ssh.html pycharm 目前还不支持配置 remote Windows interpreter,是我大意了,那就只能远程桌面了
    JerningChan
    JerningChan
    OP
    Oct 14, 2021
    15
    @UN2758 对啊,不过目前更新比以前方便就好了,毕竟,上家居然能在 win 系统来跑,我也是够服的了
    为了工资,没办法😂
    abersheeran
    abersheeran
    Oct 14, 2021
    16
    建议用代码同步工具同步上去……调试在本地
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3856 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 78ms · UTC 05:41 · PVG 13:41 · LAX 21:41 · JFK 00:41
    ♥ Do have faith in what you're doing.