asammdf icon indicating copy to clipboard operation
asammdf copied to clipboard

ModuleNotFoundError: No module named 'asammdf.blocks.cutils'

Open 113haoyuansu opened this issue 3 years ago • 4 comments

Python version

I use Python 3.10. A similar problem occurred using ASAMMDF 7.1.0. Due to this problem, I changed to 3.9 and 3.8 but the problem still exists.

MDF version

The programe cannot run properly.

Code snippet

When running asammdfgui.Py with PyCharm Community Edition 2022.2.1.

Traceback

Traceback (most recent call last): File "D:\Work\Python\asammdf-7.1.0\venv\lib\site-packages\IPython\core\interactiveshell.py", line 3398, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in <cell line: 1> runfile('D:/Work/Python/asammdf-7.1.0/asammdf/gui/asammdfgui.py', wdir='D:/Work/Python/asammdf-7.1.0/asammdf/gui') File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_umd.py", line 198, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.1\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:/Work/Python/asammdf-7.1.0/asammdf/gui/asammdfgui.py", line 13, in from asammdf.gui.utils import excepthook File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self.system_import(name, *args, **kwargs) File "D:\Work\Python\asammdf-7.1.0\asammdf_init.py", line 17, in from .mdf import MDF, SUPPORTED_VERSIONS File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\Work\Python\asammdf-7.1.0\asammdf\mdf.py", line 42, in from .blocks.mdf_v2 import MDF2 File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\Work\Python\asammdf-7.1.0\asammdf\blocks\mdf_v2.py", line 9, in from .mdf_v3 import MDF3 File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "D:\Work\Python\asammdf-7.1.0\asammdf\blocks\mdf_v3.py", line 49, in from .cutils import get_channel_raw_bytes File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) ModuleNotFoundError: No module named 'asammdf.blocks.cutils'

Description

When running asammdfgui.Py with PyCharm Community Edition 2022.2.1. I checked the problem and it should be the error message Pycharm got when calling cutils.c in the Blocks folder. Is there a problem with Pycharm software? I have one more small suggestion, using version 7.1.0. Could you add index button search for similar keywords when loading signal pages? Because sometimes there are more than 1000 signals recorded in the data, it is difficult to find. image

113haoyuansu avatar Aug 25 '22 09:08 113haoyuansu

@113haoyuansu how did you install asammdf ?

for the search you should use the search dialog (Ctrl+F)

danielhrisca avatar Aug 25 '22 10:08 danielhrisca

@danielhrisca Thanks! I think I figured out what the problem is. When I download the code from Github to my computer and run it, "No Module named 'asammdf.block.cutils'" appears. It is my own mistake, I use pip install asammdf after everything is normal. The search dialog cannot search for keywords, it must be the name of the entire signal. image image

113haoyuansu avatar Aug 26 '22 01:08 113haoyuansu

ESC_* as marked in the search dialog you can use wildcards

danielhrisca avatar Aug 27 '22 06:08 danielhrisca

Thanks a lot! @danielhrisca

113haoyuansu avatar Aug 29 '22 10:08 113haoyuansu

Hello Everyone! i'm having similar issue, but could not resolve it in conda :( (base) C:\Users\YYYYY\Documents\workspace\asammdf\examples>conda install -c conda-forge asammdf Collecting package metadata (current_repodata.json): done Solving environment: done

Package Plan

environment location: C:\Users\YYYYY\Anaconda3

added / updated specs: - asammdf

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
asammdf-7.0.3              |     pyhe74cb21_0         499 KB  conda-forge
canmatrix-0.8              |             py_0         174 KB  conda-forge
natsort-8.2.0              |     pyhd8ed1ab_0          36 KB  conda-forge
openssl-1.1.1s             |       hcfcfb64_0         5.9 MB  conda-forge
ucrt-10.0.22621.0          |       h57928b3_0         1.2 MB  conda-forge
xlwt-1.3.0                 |             py_1          83 KB  conda-forge
------------------------------------------------------------
                                       Total:         7.9 MB

The following NEW packages will be INSTALLED:

asammdf conda-forge/noarch::asammdf-7.0.3-pyhe74cb21_0 None canmatrix conda-forge/noarch::canmatrix-0.8-py_0 None isa-l conda-forge/win-64::isa-l-2.30.0-h8ffe710_4 None natsort conda-forge/noarch::natsort-8.2.0-pyhd8ed1ab_0 None python-isal conda-forge/win-64::python-isal-1.1.0-py39ha55989b_1 None python_abi conda-forge/win-64::python_abi-3.9-2_cp39 None ucrt conda-forge/win-64::ucrt-10.0.22621.0-h57928b3_0 None xlwt conda-forge/noarch::xlwt-1.3.0-py_1 None

The following packages will be UPDATED:

conda pkgs/main::conda-22.9.0-py39haa95532_0 --> conda-forge::conda-22.9.0-py39hcbf5309_2 None vs2015_runtime pkgs/main::vs2015_runtime-14.27.29016~ --> conda-forge::vs2015_runtime-14.32.31332-h1d6e394_9 None

The following packages will be SUPERSEDED by a higher-priority channel:

ca-certificates pkgs/main::ca-certificates-2022.10.11~ --> conda-forge::ca-certificates-2022.9.24-h5b45459_0 None certifi pkgs/main/win-64::certifi-2022.9.24-p~ --> conda-forge/noarch::certifi-2022.9.24-pyhd8ed1ab_0 None openssl pkgs/main::openssl-1.1.1s-h2bbff1b_0 --> conda-forge::openssl-1.1.1s-hcfcfb64_0 None

Proceed ([y]/n)? y

Downloading and Extracting Packages xlwt-1.3.0 | 83 KB | ############################################################################ | 100% natsort-8.2.0 | 36 KB | ############################################################################ | 100% openssl-1.1.1s | 5.9 MB | ############################################################################ | 100% ucrt-10.0.22621.0 | 1.2 MB | ############################################################################ | 100% asammdf-7.0.3 | 499 KB | ############################################################################ | 100% canmatrix-0.8 | 174 KB | ############################################################################ | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done Retrieving notices: ...working... done

(base) C:\Users\YYYYY\Documents\workspace\asammdf\examples>python mf4_demo.py Traceback (most recent call last): File "C:\Users\YYYYY\Documents\workspace\asammdf\examples\mf4_demo.py", line 3, in from asammdf import MDF, Signal File "C:\Users\YYYYY\Anaconda3\lib\site-packages\asammdf_init_.py", line 17, in from .mdf import MDF, SUPPORTED_VERSIONS File "C:\Users\YYYYY\Anaconda3\lib\site-packages\asammdf\mdf.py", line 42, in from .blocks.mdf_v2 import MDF2 File "C:\Users\YYYYY\Anaconda3\lib\site-packages\asammdf\blocks\mdf_v2.py", line 9, in from .mdf_v3 import MDF3 File "C:\Users\YYYYY\Anaconda3\lib\site-packages\asammdf\blocks\mdf_v3.py", line 49, in from .cutils import get_channel_raw_bytes ModuleNotFoundError: No module named 'asammdf.blocks.cutils'

Some help much appreciated!

saideepthik avatar Nov 24 '22 10:11 saideepthik

Go to pypi, download the 7.0.3 wheel that fits your python version, extract the archive and manually copy the cutils.pyd to your conda asammdf/blocks folder

danielhrisca avatar Nov 24 '22 10:11 danielhrisca

Hi @danielhrisca; Thanks for the quick response, i have tried the same as suggested, still i have same issue. i have used https://pypi.org/project/asammdf/7.0.3/#files first i tried the latest build(cp310) was not working, then i tried all builds. still nothing working. please let me know is there any other way to resolve this issue :( i have tried in this three locations, please let me know if its something wrong i have to change:

  1. C:\Users\YYYYY\Anaconda3\pkgs\asammdf-7.0.3-pyhe74cb21_0\site-packages\asammdf\blocks
  2. C:\Users\YYYYY\Anaconda3\Lib\site-packages\asammdf\blocks
  3. C:\Users\YYYYY\Documents\workspace\asammdf\asammdf\blocks (i dont know will it effect or not) first i tried one by one then i tried individually.

File name : cutils.cp310-win_amd64.pyd and i have so file also in these folders, will it confuse the compiler while running? here is the file name : cutils.cpython-310-x86_64-linux-gnu.so i trailed deleting and keeping it back also nothing effective. Much awaiting for response!!!

saideepthik avatar Nov 24 '22 13:11 saideepthik

what python version do you have?

danielhrisca avatar Nov 24 '22 14:11 danielhrisca

Python 3.9.15

saideepthik avatar Nov 24 '22 14:11 saideepthik

you need to extract this wheel https://files.pythonhosted.org/packages/04/fe/89ec11f669a7d6e4d7e36ad83920e2309c1491738c40b858fb449a9a506e/asammdf-7.0.3-cp39-cp39-win_amd64.whl

! keep in mind that you need 64 bit Python

C:\Users\usr>python
Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 **64 bit** (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

danielhrisca avatar Nov 24 '22 14:11 danielhrisca

Wow! its working finally after consuming hell of time, it's better to post always when we get stuck somewhere!

@danielhrisca Thank you so much, and i would like to know what went wrong and why is this file missing from the library while installing through conda if you can elaborate for future knowledge!

FYI: Python 3.9.15 (main, Nov 23 2022, 09:27:34) [MSC v.1916 64 bit (AMD64)] on win32 What i did to resolve it; copied the pyd file as suggested into this folder and everything works! C:\Users\YYYYY\Anaconda3\Lib\site-packages\asammdf\blocks

saideepthik avatar Nov 24 '22 15:11 saideepthik

I have no idea what happened, the conda package contains cutil.pyd image

danielhrisca avatar Nov 24 '22 15:11 danielhrisca

I had the same issue. ModuleNotFoundError: No module named 'asammdf.blocks.cutils'. I installed asammdf on conda via jupyter notebook. Used !pip install asammdf. checked my python version -Python 3.9.16. I'm able to see cutils in local directory under blocks. As mentioned, I copied the cutil.pyd file from asammdf/7.07/files. This took much time unnecessarily to figure out. Thank you guys for helping out.❤

GodwinGeorge avatar Jan 20 '23 10:01 GodwinGeorge