Code Monkey home page Code Monkey logo

Comments (3)

jonasmalacofilho avatar jonasmalacofilho commented on June 12, 2024

Where is usb find automatically looking for the libraries? I thought it was system32, but adding .dlls there didnt help.

That's correct. Although, technically, we delegate that to ctypes, which delegates to the OS (this can sometimes be relevant).

My first suggestion is for you to check that the DLL architecture matches the Python interpreter you're running on.

After that, use ProcessMonitor to check which paths are being tested, which files are found, etc... maybe something else is overriding the default search paths for DLLs.

from pyusb.

calugaruful-dotcom avatar calugaruful-dotcom commented on June 12, 2024

I wouldnt think the interpreter is the issue, since on the second computer I am using same python version, same interpreter. As for the process monitor suggestion, could you elaborate on that please? Could you give an example how I might I go about doing that?

from pyusb.

jonasmalacofilho avatar jonasmalacofilho commented on June 12, 2024

I wouldnt think the interpreter is the issue, since on the second computer I am using same python version, same interpreter.

Personally, I would check it anyway: you're already looking into a "weird" behavior, in that it works on all but one machine. At that point I think any expectations involving the word "same" are out the window... Also, the interpreter and DLLs need to be checked.

As for the process monitor suggestion, could you elaborate on that please? Could you give an example how I might I go about doing that?

As far as I remember it has a fairly intuitive interface (I don't have a Windows box at hand right now). Just open it and (IIRC) it starts to show the activity from all processes (you can also filter by process name, PID, etc).

Next, start your program—or, preferably, a minimal example that only tries to list all USB devices... import usb; usb.core.find(find_all=True)—and watch Process Monitor for what paths are accessed in one way or another.


One more thing: I'm not sure how Windows would behave if it finds a DLL with the correct name but wrong architecture in the search path. Does it keep looking for other DLLs (with that name) in (other locations in) the search path anyway, or will it only attempt to load that first, wrong, one?

from pyusb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.