Forums Niryo One Troubleshooting Python API import Error

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Arif Saeed
    Participant
    Post count: 7

    I created a test python file using the example on Github. my code is below, the only change i made was to add a print statement to it.  The code has no functionality in it, but its generating an error msg that seems to be originating from the import of the Niryo One API.  Can you please help me identify the problem.

    Details of what i did are below:

    I saved the python  file on the Niryo One using the command:
    cp /filelocation/test.py niryo@192.168.0.45:~

    I then ran the command:
    chmod +x ./test.py

    I then ran the command
    ./test.py.

    And i get the error “except rospy.ROSException, e:”

    The error statement seems to imply the the error is originating from the import statement:

    from niryo_one_python_api.niryo_one_api import *

    Python Error

     

    My Python Code:

    from niryo_one_python_api.niryo_one_api import *
    import rospy
    import time
    rospy.init_node(‘niryo_one_example_python_api’)

    n = NiryoOne()

    try:
    print(“start”)
    except NiryoOneException as e:
    print (e)
    # Handle errors here

    Arif Saeed
    Participant
    Post count: 7

    I was using the wrong command, you need to use the command in the documents:

    export PYTHONPATH=${PYTHONPATH}:/home/niryo/catkin_ws/src/niryo_one_python_api/src/niryo_python_api && python pythonfile.py

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.