Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After pyxcp packages this script as an exe by pyinstaller, the following error occurs when running it. How to solve it? #203

Open
XuHaobang opened this issue Jan 16, 2025 · 3 comments

Comments

@XuHaobang
Copy link

After pyxcp packages this script as an exe by pyinstaller, the following error occurs when running it. How to solve it?
image

Traceback (most recent call last):
File "Test222.py", line 8, in
File "pyxcp\cmdline.py", line 45, in run
File "pyxcp\master\master.py", line 77, in init
File "pyxcp\transport\base.py", line 428, in create_transport
File "pyxcp\transport\can.py", line 332, in init
File "pyxcp\transport\can.py", line 238, in init
File "can\interface.py", line 42, in _get_class_for_interface
can.exceptions.CanInterfaceNotImplementedError: Cannot import module can.interfaces.vector for CAN interface 'vector': No module named 'can.interfaces.vector'

my python code:
import time

from pyxcp.cmdline import ArgumentParser
import logging
logging.basicConfig(level=logging.DEBUG)

ap = ArgumentParser(description="conf_can_user.toml")
with ap.run() as x:
print(111111111111111)
print(dir(x.transport.config))
conn = x.connect()
x.setMta(0x70b632, 0x00)
Characteristic_Value = x.shortUpload(2, 0x70b632, 0x00)
print(f"Characteristic_Value = {Characteristic_Value}")
print(99999999999999)
time.sleep(10)
x.disconnect()

@XuHaobang
Copy link
Author

@christoph2 can you help me sure?

@XuHaobang
Copy link
Author

it is ok, we can add import can.interfaces.vector in your main.py, then build to exe

image

@christoph2
Copy link
Owner

Hello,

Well, your application code looks OK, but everything else is really wild!

The pyxcp.transport.candriver tree was moved to pyxcp.config many months ago -- it seems you are mixing up-to-date code with completly outdated code...
And in particular, I don't understand these pyinstaller action!?

You may do the following:

  1. Run a regular installation:
pip install pyxcp
    • Download/clone pyXCP
    • Then run the build process from the project root directory (requires an up-to-date C++ compiler and cmake as build system):
    pip install -e .

Yes I know, documentation is the leading pyXCP issue, but here is a good introduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants