首页 > 解决方案 > LightRun Python 代理错误:TypeError:只能将 str(不是“NoneType”)连接到 str

问题描述

当我尝试运行Lightrun python 代理时,我收到此错误:

$ python3 main.py

Traceback (most recent call last):
File "main.py", line 4, in <module>
lightrun.enable(com_lightrun_server="https://app.lightrun.com/soumibardhan",
File "<frozen lightrun>", line 142, in enable
File "<frozen lightrun>", line 73, in _StartDebugger
File "<frozen lightrun.hub_client>", line 89, in __init__
TypeError: can only concatenate str (not "NoneType") to str  

复制:

https://app.lightrun.com:8443/auth/realms/lightrun/protocol/openid-connect/registrations?client_id=web_app&response_type=code&redirect_uri=https://app.lightrun.com

第二步我选择了pycharm和python。下一步,登录,工作。但是尝试运行代理会出现此错误。

这是我的 main.py :

if __name__ == '__main__':
    try:
        import lightrun
        lightrun.enable(com_lightrun_server="https://app.lightrun.com/soumibardhan",
                        com_lightrun_secret="<your personal token>")
    except ImportError as e:
        print("Error importing Lightrun: ", e)
    print('PyCharm')

只需在此处替换您的令牌或按照 lightrun 安装步骤操作即可。

我被困在这一步。请帮忙。

标签: pythoninstallationpycharmtypeerror

解决方案


请注意,您应该使用的 URL 是:

lightrun.enable(com_lightrun_server='https://app.lightrun.com/company/soumibardhan', com_lightrun_secret='XXXX')

(注意添加/company/)。


推荐阅读