SimpleFOC Studio is difficult to install

I have been trying to install simpleFOC studio from the directions at SimpleFOCStudio | Arduino-FOC
with no luck.
Those instructions fail to install python 3.6, so instead I just let it install the latest version.
Here is what happens when I try to follow the instructions.
Any help will be much appreciated.
• Anaconda installs without error.
• conda create -n simplefoc python=3.6.0 fails
• conda create -n simplefoc python succeeds
• conda activate simplefoc succeeds
• successfully cloned the github repository at GitHub - JorgeMaker/SimpleFOCStudio: A GUI based in PyQT5 and PyQtGraph to configure and control SimpleFOC devices.
• conda activate simplefoc succeeds

This is the error where I am currently stuck:

pip install -r “requirements.txt”
Collecting PyQt5==5.15.2
Using cached PyQt5-5.15.2.tar.gz (3.3 MB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [29 lines of output]
Traceback (most recent call last):
File “C:\Users\Mike.conda\envs\simplefoc\lib\site-packages\pip_vendor\pep517\in_process_in_process.py”, line 144, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel’

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "C:\Users\Mike\.conda\envs\simplefoc\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
      main()
    File "C:\Users\Mike\.conda\envs\simplefoc\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Users\Mike\.conda\envs\simplefoc\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 148, in prepare_metadata_for_build_wheel
      whl_basename = backend.build_wheel(metadata_directory, config_settings)
    File "C:\Users\Mike\AppData\Local\Temp\pip-build-env-rwdt3dsg\overlay\Lib\site-packages\sipbuild\api.py", line 46, in build_wheel
      project = AbstractProject.bootstrap('wheel',
    File "C:\Users\Mike\AppData\Local\Temp\pip-build-env-rwdt3dsg\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 87, in bootstrap
      project.setup(pyproject, tool, tool_description)
    File "C:\Users\Mike\AppData\Local\Temp\pip-build-env-rwdt3dsg\overlay\Lib\site-packages\sipbuild\project.py", line 585, in setup
      self.apply_user_defaults(tool)
    File "C:\Users\Mike\AppData\Local\Temp\pip-install-xeyr7tqh\pyqt5_25bd783e5b24434e93ef0aa0bbe94497\project.py", line 63, in apply_user_defaults
      super().apply_user_defaults(tool)
    File "C:\Users\Mike\AppData\Local\Temp\pip-build-env-rwdt3dsg\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
      super().apply_user_defaults(tool)
    File "C:\Users\Mike\AppData\Local\Temp\pip-build-env-rwdt3dsg\overlay\Lib\site-packages\sipbuild\project.py", line 236, in apply_user_defaults
      self.builder.apply_user_defaults(tool)
    File "C:\Users\Mike\AppData\Local\Temp\pip-build-env-rwdt3dsg\overlay\Lib\site-packages\pyqtbuild\builder.py", line 69, in apply_user_defaults
      raise PyProjectOptionException('qmake',
  sipbuild.pyproject.PyProjectOptionException
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(simplefoc) PS C:\Users\Mike\documents\github\SimpleFOCStudio>

228 / 5.000

Hi @PickyBiker

It seems that you have some problem with the installation of Python. You can try to install PyCharm and create a project using the code that is in the repository which might help to see what is wrong.

Best regards !!!

Got a little further, now I am at the point where I run python simpleFOCStudio.py and this is the result:

Traceback (most recent call last):
File “C:\Users\Mike\documents\github\simplefocstudio\simpleFOCStudio.py”, line 8, in
from src.gui.mainWindow import UserInteractionMainWindow
File “C:\Users\Mike\documents\github\simplefocstudio\src\gui\mainWindow.py”, line 5, in
from src.gui.toolbar import SimpleFOCConfigToolBar
File “C:\Users\Mike\documents\github\simplefocstudio\src\gui\toolbar.py”, line 4, in
from src.gui.sharedcomnponets.sharedcomponets import GUIToolKit
File “C:\Users\Mike\documents\github\simplefocstudio\src\gui\sharedcomnponets\sharedcomponets.py”, line 6, in
from serial.tools import list_ports
ModuleNotFoundError: No module named ‘serial’

Maybe you have some problem with the module that handles te serial port communion… its is includes at the requirements.txt but maybe is not working. Try to execute: pip install pyserial and try to verify is this module is working properly.

It seems it is already installed.

(base) PS C:\Users\Mike> pip install pyserial
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyserial in c:\users\mike\appdata\roaming\python\python39\site-packages (3.5)
(base) PS C:\Users\Mike>

This is much more difficult to install than it should be. I suspect many required packages have evolved since the original installation instructions were written, and now one must be quite proficient at debugging and programming just to install it.

Totally frustrated.

1 Like

If you have another computer to test, I suggest you give it a try. I’m not sure why you’re having problems ;(

I reloaded windows 11 from scratch and then using the built-in command prompt, I loaded the simplefoc studio files in requirements.text WITHOUT the version numbers. Installed PyCharm and got the Studio to load. Did not load or use anaconda. I set the com port and got connected.

Now to figure out how to run it. Do I need to load any special code in the arduino to run studio?
Here is my environment:

Arduino UNO
SimpleFOC shield Version 2.0.3
BGM41-8-130T motor
CUI AMT-103 2048 PPR

1 Like

On the Arduino side, you have to use the Commander, and use addMotor() to enable full motor control in the commander (see our full-control examples, and the commander docs).

After that, you enter the character of the motor (like ‘M’) into the Command box in SimpleFOC Studio, and click “Connect”.

Glad to hear you got it working, and sorry to hear it was so much trouble for you!

conda create -n simplefoc python=3.9.0

2 Likes

I am not using conda now. I loaded python via the built-in command prompt and didn’t use a version number. That resulted in loading python version 3.10.9

Nice to hear that you were able to load SimpleFOCStudio. Yo have to follow the explanation and not forget the following importante part:

Windows 11 on 3/20/2023. I had all of these exact problems as described. Changing the python version allowed me to start over after deleting the environment in Anaconda Navigator. The instructions that worked for me:
conda create -n simplefoc python=3.9.0
conda activate simplefoc
cd C:\Users[…my path to the clone…]\GitHub\SimpleFOCStudio
pip install -r “requirements.txt”
python simpleFOCStudio.py

And just like that, it worked

2 Likes

Nice to hear that you were able to solve the issue which is more related with the Python environment than with the application itself. I will try simplify the instructions.

I would suggest not using anaconda. It just doesn’t seem to be necessary.

1 Like