Runtime error R6034 in embedded Python application

前端 未结 13 1213
暗喜
暗喜 2020-12-04 10:06

I am working on an application which uses Boost.Python to embed the Python interpreter. This is used to run user-generated \"scripts\" which interact with the main program.<

13条回答
  •  萌比男神i
    2020-12-04 11:02

    Using Michael's answer above, I was able to resolve this without a bat file by adding:

    import os
    
    # Remove CLS Client from system path
    if os.environ['PATH'].find("iCLS Client")>=0:
        os.environ['PATH'] = "".join([it for it in os.environ['PATH'].split(";") if not it.find("iCLS Client")>0])
    

    to the main python file of the application. It just makes sure system path didn't include the paths that were causing the issue before the libraries that loaded the dll's were imported.

    Thanks!

提交回复
热议问题