platomav / BIOSUtilities

Collection of various BIOS/UEFI-related utilities which aid in research and/or modding purposes.
Other
818 stars 159 forks source link

Windows Error: ModuleNotFoundError: No module named 'common.checksums' #17

Closed dribgnikcom closed 1 year ago

dribgnikcom commented 1 year ago

The script runs on Linux, but on Windows 7 with Python 3.8 installed, I get this error:

Traceback (most recent call last): File "Dell_PFS_Extract.py", line 23, in from common.checksums import get_chk_8_xor ModuleNotFoundError: No module named 'common.checksums'

I tried installing the common module with pip, it seems to have installed something, but it did not solve the issue.

platomav commented 1 year ago

Python 3.10 or newer is required, as explained at the README for the project. There is no "common" module, it's a folder which accompanies the script, which is probably missing in your case for whatever reason. Closing this as it is not an issue with the repository code.

dribgnikcom commented 1 year ago

Thanks, I thought so and tried with the folder present (i.e. downloaded the whole project as a zip)... But I'll need to check if this is a global path directive issue in Windows.

mikebeaton commented 1 year ago

This is not working for me with standard Windows python3, not even with PYTHONPATH (set to . or to full project directory), but it is working, without needing PYTHONPATH, if I install and use python3.10 on WSL.

platomav commented 1 year ago

In my experience, the safest way to get most pre-existing python projects to work, is to manually download and use the installer from the official python website.

The python versions installed by Windows (e.g. store, WSL etc) exhibit weird behaviors when it comes to "path" environment variables, python executable alias names and more. Some more info about this can be found at another project of mine, in case it helps: https://github.com/platomav/MEAnalyzer/issues/41.

But in general, uninstall whatever built-in python is there and re-install using the official offline installer from the python website. This has never failed me at Windows 11 x64 and latest (as of now) Python 3.11 releases.

Also, make sure to call/run the utilities from the repo/project root folder, not outside. This is a different python-related annoyance, which has to do with the (badly designed, IMHO) import/packaging system in Python 3. I will attempt to fix that, as good as I can, at an upcoming release (reference).

67113513 commented 1 year ago

I faced same issue, and fix it by moving common to bioscommon and changing all 'import common.' to 'import bioscommon.'. Guess there is a system package also named 'common' on somewhere.