msoon / PyMonsoon

Monsoon Power Monitor Python Library
MIT License
55 stars 23 forks source link

ModuleNotFoundError: No module named 'pmapi' #23

Closed lycfr closed 6 years ago

lycfr commented 6 years ago

Traceback (most recent call last): File "D:/pythonworkpace/PyMonsoon/examples/ExampleSolution/periodicSamplingExample.py", line 1, in import Monsoon.HVPM as HVPM File "D:\pythonworkpace\PyMonsoon\Monsoon\HVPM.py", line 10, in import pmapi ModuleNotFoundError: No module named 'pmapi'

msoonjared commented 6 years ago

Comment out line 10 in HVPM.py and remove the commenting of line 11 so that you are using "from Monsoon import pmapi" instead of just "import pmapi". If you are using Python 3 it requires the more specific import code to work properly, Python 2 should work with "import pmapi".

lycfr commented 6 years ago

@msoonjared I modified according to your course, after the re-run, or will be error. Traceback (most recent call last): File "D:/pythonworkpace/PyMonsoon/examples/ExampleSolution/ReflashExample.py", line 7, in <module> Mon.setup_usb() File "D:\pythonworkpace\PyMonsoon\Monsoon\reflash.py", line 29, in setup_usb DEVICE = usb.core.find(idVendor=0x2AB9,idProduct=0xFFFF) File "D:\Program Files\Python3\lib\site-packages\usb\core.py", line 1263, in find raise NoBackendError('No backend available') usb.core.NoBackendError: No backend available but I have installed the drive, libusb has also been successfully installed, my compiler environment is window64, python3.6.5. Every time I run, I report DEVICE = usb.core.find(idVendor=0x2AB9, idProduct=0xFFFF) I'm a little frustrated

lycfr commented 6 years ago

I have found reason to solve

lycfr commented 6 years ago

3Q