PyVESC icon indicating copy to clipboard operation
PyVESC copied to clipboard

Cannot import name 'VESC' from 'pyvesc'

Open MarTru21 opened this issue 4 years ago • 8 comments

Hi, I'm trying to run your motor_example.py, but I 'm getting the error "cannot import name 'VESC' from 'pyvesc'." Any idea why this may be? I believe I'm working in python 3, but I'm new to coding in Python. Thanks!

MarTru21 avatar Mar 22 '21 19:03 MarTru21

Try installing the newest version of the library using:

pip install git+https://github.com/LiamBindle/PyVESC

TannerGilbert avatar Mar 28 '21 18:03 TannerGilbert

hi i have the same problem :

pi@raspberrypi:~ $ pip3 install git+https://github.com/LiamBindle/PyVESC Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting git+https://github.com/LiamBindle/PyVESC Cloning https://github.com/LiamBindle/PyVESC to /tmp/pip-req-build-m2xv4k34 Requirement already satisfied (use --upgrade to upgrade): pyvesc==1.0.5 from git+https://github.com/LiamBindle/PyVESC in /usr/local/lib/python3.7/dist-packages Requirement already satisfied: crccheck in ./.local/lib/python3.7/site-packages (from pyvesc==1.0.5) (1.0) Building wheels for collected packages: pyvesc Running setup.py bdist_wheel for pyvesc ... done Stored in directory: /tmp/pip-ephem-wheel-cache-imgiad77/wheels/98/57/5e/5cf496be02b66fe4f643351fb30d326009f1abd58aa90eda10 Successfully built pyvesc pi@raspberrypi:~ $ python3 motor_example.py Traceback (most recent call last): File "motor_example.py", line 1, in from pyvesc import VESC ImportError: cannot import name 'VESC' from 'pyvesc' (/usr/local/lib/python3.7/dist-packages/pyvesc/init.py) pi@raspberrypi:~ $

the same as sudo

robbyatbln avatar May 18 '21 08:05 robbyatbln

@robbyatbln: What worked for me was to "pip remove" the pyvesc, delete everything pyvesc-related from the disk and then install again from newest source as @TannerGilbert suggested.

FrenkK avatar May 18 '21 08:05 FrenkK

This worked for us:

pip uninstall PyCRC
pip install pythoncrc

nakai-omer avatar Jan 02 '23 15:01 nakai-omer

Sadly I have pretty much given up on this library ( I have tried for 3 days) things I have tried

Virtual Machine Version Matching Docker

I have had zero luck, I have just defaulted to writing my program in C++.

I have pyvesc install yet I get the following messages (This is extremely irritating)

Documents/code/PyVESC/pyvesc/examples$ python3 motor_example.py 
Traceback (most recent call last):
  File "/home/mwesideveloper/Documents/code/PyVESC/pyvesc/examples/motor_example.py", line 1, in <module>
    from pyvesc import VESC
ImportError: cannot import name 'VESC' from 'pyvesc' (/home/mwesideveloper/.local/lib/python3.10/site-packages/pyvesc/__init__.py)

moeec avatar Nov 24 '23 13:11 moeec