Connect by Python

Typically: "How do I... ", "How can I... " questions
Post Reply
t2chiang
Posts: 3
Joined: 23 Mar 2024, 23:10

Connect by Python

Post by t2chiang »

Hello, I want to connect the python with coppeliasim. However, when I try

Code: Select all

simRemoteApi.start(19997)
, I got the error shown below:

Code: Select all

[/UR5[0]/RG2/detectionCamera@childScript:error] ...es/CoppeliaRobotics/CoppeliaSimEdu/lua/pythonWrapper.lua:336: The Python interpreter could not be called. It is currently set at: 'c:/CONY/SRIP/practice/venv/Scripts/python.exe'. You can specify it in C:\Users\USER\AppData\Roaming/CoppeliaSim/usrset.txt with 'defaultPython', or via the named string parameter 'pythonWrapper.python' from the command line
stack traceback:
    [C]: in function 'error'
    ...es/CoppeliaRobotics/CoppeliaSimEdu/lua/pythonWrapper.lua:336: in function 'initPython'
    ...es/CoppeliaRobotics/CoppeliaSimEdu/lua/pythonWrapper.lua:225: in function 'sysCall_init'
[/UR5[0]@childScript:error] 1: in simRemoteApi.start@simExtRemoteApi: Invalid port number.
stack traceback:
    [C]: in function 'simExtRemoteApiStart'
    [string "/UR5[0]@childScript"]:1: in function 'sim_code_function_to_run'
I am using coppeliasim 4.5 edu so I think the version is not the issue. And something weird is that after I got the error above, the simulation succeed if I run the simulation again. What is the potential problem of this situation?

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Connect by Python

Post by coppelia »

Hello,

see my answer to your other post.

Cheers

Post Reply