ActivityWatch / activitywatch

The best free and open-source automated time tracker. Cross-platform, extensible, privacy-focused.
https://activitywatch.net/
Mozilla Public License 2.0
11.32k stars 512 forks source link

Issue with Building ActivityWatch: ModuleNotFoundError: No module named 'aw_server' #1041

Closed kcs-santoshahire closed 1 month ago

kcs-santoshahire commented 3 months ago

Discussed in https://github.com/orgs/ActivityWatch/discussions/1039

Originally posted by **kcs-santoshahire** April 4, 2024 I encountered an issue while trying to build ActivityWatch following the steps outlined in the documentation (https://docs.activitywatch.net/). After cloning the project repository and attempting to build it using the make build command, I received the following error: `python -c "import aw_server; print(aw_server.__version__)" Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aw_server' make: *** [build] Error 1 ` Description: It seems that the build process is failing due to a missing module named 'aw_server'. I followed the installation instructions provided in the documentation, but I'm unable to proceed with the build due to this error. Steps to Reproduce: Clone the ActivityWatch repository from GitHub. Follow the installation instructions provided in the documentation. Attempt to build the project using the make build command. Expected Behavior: The build process should complete successfully without any errors, allowing me to proceed with running ActivityWatch. Actual Behavior: The build process fails with a ModuleNotFoundError for 'aw_server', preventing me from completing the build and running the application. Additional Information: Operating System: Windows 11 Python Version: 3.8.0 Any other relevant details about your environment or setup. I would appreciate any assistance in resolving this issue so that I can successfully build and use ActivityWatch. Thank you for your attention to this matter. Best regards, Santosh Ahire
github-actions[bot] commented 3 months ago

Hi there! As you're new to this repo, please make sure you've used an appropriate issue template and searched for duplicates (it helps us focus on actual development!). We'd also like to suggest that you read our contribution guidelines and our code of conduct. Thanks a bunch for opening your first issue! 🙏

MohammadAliAfsahi commented 1 month ago

Facing the same issue on linux. Any update on this issue?

ErikBjare commented 1 month ago

The error most frequently occurs if you have not activated a Python virtual environment before starting the build.

MohammadAliAfsahi commented 1 month ago

The error most frequently occurs if you have not activated a Python virtual environment before starting the build.

I have activated the Python virtual environment

ErikBjare commented 1 month ago

Then you need to figure out why it can't find aw_server in the Python environment (what the check is for), after it has just been installed.

MohammadAliAfsahi commented 1 month ago

Then you need to figure out why it can't find aw_server in the Python environment (what the check is for), after it has just been installed.

basically the following command does not have any output which indicates it is not installed.

pip freeze | grep server

I'll try to figure out what is the main reason then update this thread.

MohammadAliAfsahi commented 1 month ago

@ErikBjare So the main reason that aw-server does not get installed is the following error

Screenshot from 2024-05-10 19-52-42

which is in aw-webui submodule: aw-server/aw-webui/vue.config.js:42:2

I could fix the issue by changing line 49 from the following: domain: import.meta.resolve('domain-browser'),

to

domain: path.resolve(__dirname, 'domain-browser'),

ErikBjare commented 1 month ago

@MohammadAliAfsahi Which Nodejs version are you running? I don't think that occurs for Node 18+ (at least not for Node 20 in CI).

MohammadAliAfsahi commented 1 month ago

@MohammadAliAfsahi Which Nodejs version are you running? I don't think that occurs for Node 18+ (at least not for Node 20 in CI).

Yep. The main reason is Node version which is 16 in my case.

ErikBjare commented 1 month ago

Should update the docs to mention needing Node v20+, since that's what we use in CI.

On Fri, May 10, 2024, 19:20 MohammadAliAfsahi @.***> wrote:

@MohammadAliAfsahi https://github.com/MohammadAliAfsahi Which Nodejs version are you running? I don't think that occurs for Node 18+ (at least not for Node 20 in CI).

Yep. The main reason is Node version which is 16 in my case.

— Reply to this email directly, view it on GitHub https://github.com/ActivityWatch/activitywatch/issues/1041#issuecomment-2104987701, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKXDOXMWOYVZBLSZMAQMDDZBT6WDAVCNFSM6AAAAABFYUSFC2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUHE4DONZQGE . You are receiving this because you were mentioned.Message ID: @.***>

ErikBjare commented 1 month ago

I fixed the issue where the aw-server build failed silently, causing the later error: https://github.com/ActivityWatch/activitywatch/commit/0520dd0727f261214742c98398f5e471bf7c6b70

Will also update the docs.