NameError: name 'odrivetool' is not defined

Hello. I’ve already spent hours trying to figure out why this python code doesn’t work. I am using Anaconda, but I don’t understand how to fix the “path”.
I keep getting this error when I try to calibrate the motor:
{
“fw_version”: “0.6.6”,
“commit_hash”: 307587176,
“product”: “5.2.0”,
“active_errors”: 0,
“active_errors_str”: “NONE”,
“disarm_reason”: 2,
“disarm_reason_str”: “SYSTEM_LEVEL”,
“procedure_result”: 3,
“procedure_result_str”: “DISARMED”,
“last_drv_fault”: 0,
“internal_issues”: 0
}
I am clueless how to fix this. I would have to say that this motor controller is NOT VERY GOOD if it’s going to be so DIFFICULT to use. I feel that tutorial video just INSULT us. There’s no mention of what Python tool to use. I’m new to Python, so it’s all very confusing.

Hello

When you include screenshots of what you are trying to do, people will be more likely to help you because with little information, we can’t help you. Post some screenshots of what you are trying to do and also of the errors you are getting.

Cheers

Carelsbergh Stijn

1 Like

Hi, I’m sorry you’re having difficulties with the python library. As Stijn_Carelsbergh mentioned could you please include some screenshots of where you are seeing this error?

Which tutorial video are you referring to? In general I would suggest using the web GUI to configure and calibrate your ODrive, it does not require installing or writing any Python code.

If Python is really the only option you can find installation and usage instructions for odrivetool here.

1 Like

Thank you. I did include the error that the GUI was showing me.
I don’t know why, but my computer at work (a modern, lousy laptop) doesn’t do so well with this as my computer at home (an old, but real desktop computer).
Here I keep getting a SYSTEM_ERROR message, while at home this problem doesn’t happen. I don’t understand why the web GUI is so sensitive to which computer I use.
Now that I’ve got it calibrated, it seems to work with the web GUI. Now my goal is to use an Arduino or Raspberry Pi to operate it.

1 Like

Here were go again:
{
“fw_version”: “0.6.6”,
“commit_hash”: 307587176,
“product”: “5.2.0”,
“active_errors”: 0,
“active_errors_str”: “NONE”,
“disarm_reason”: 2,
“disarm_reason_str”: “SYSTEM_LEVEL”,
“procedure_result”: 3,
“procedure_result_str”: “DISARMED”,
“last_drv_fault”: 0,
“internal_issues”: 0
}
Here’s the screenshot that goes with this message.


I’ve tried doing the firmware update, but the “Odrivetool” will not run.

Richard V

The instruction on this website are horrible. They don’t tell you “how” to run Python. I tried running it from a Windows command prompt: FAILED
I tried running it in standalone window for Python: FAILED:
You won’t see it here, but I was able to INSTALL this code in JuPyter Notes, but it does NOT recognize “odrivetool” or “odrive”.

Here I am trying to run this Python code in Jupyter Notebook.
I was able to install and upgrade the tool, but I cannot LAUNCH it.

Funny thing, this works on my home computer.
It only fails here at work, where I actually need it.
Why would using different computers matter?
Could it be that our firewall is interfering?

Hello

Seems like you have not installed pip yet. This normally comes automatically with installing Python, but you can install it separately.

Cheers

Carelsbergh Stijn

Hi Richard, odrivetool is a .bat file (on windows) which launches an ipython instance, which then runs the python interface that we use as examples in the documentation.

The odrivetool.bat lives in your python package installation directory, which varies by version, OS, and user privilege. The best way to figure out where this file lives on Windows is to download the “Search Everything” app from voidtools, and look for odrivetool.bat.

Once you find it, you will want to put that path on your Windows Environment PATH. Look for Environment Variables → PATH → Edit → Browse or Add. A YouTube tutorial may help to explain this in your native language, as it may be different due to localization. This missing entry is why you get the error that odrivetool is undefined (Windows cannot find any executables called “odrivetool” on your PATH)

Alternatively, you can uninstall Python, use voidtools Everything to find and delete all mentions of Python, then reinstall Python, making sure to install both pip and click the box that says “Add Scripts folder to PATH” or similar. This should fix the problem

That doesn’t make sense because the installation and upgrade go along smoothly, and they use the pip command.

Which part works at home but not at work, the GUI or odrivetool?
There seems to be two separate issues:

  1. The SYSTEM_LEVEL error you’re seeing in the GUI
    When does this error show up, as soon as it connects or after you try running the calibration?
    If it is from the calibration, what is the configuration you’re using? This error can be the result of setting the calibration voltage too high.

  2. python/odrivetool
    2.1 You’re running pip install matplotlib from inside the Python3.11 shell, but this isn’t right. This should run in the regular windows command prompt or Powershell (the other windows terminal).
    2.2 Similar issue with running odrivetool, you can’t run this from inside Python (Jupyter Notebook, ipython shell etc.), the odrivetool command should work in the windows command prompt or Powershell. odrivetool uses Python which is why Python needs to be installed, but it doesn’t need to run in Python.

I would strongly suggest you use the GUI instead of Python if you can, this SYSTEM_LEVEL error will not be unique to the GUI. Python can be a significant bar for entry, especially on Windows. This is one of the reasons we have created a web base GUI, you don’t have to worry about installing anything to make it work.