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

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

Closed
kcs-santoshahire opened this issue Apr 5, 2024 Discussed in #1039 · 11 comments

Comments

@kcs-santoshahire
Copy link

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 "<string>", line 1, in <module> 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

Copy link

github-actions bot commented Apr 5, 2024

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
Copy link
Contributor

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

@ErikBjare
Copy link
Member

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

@MohammadAliAfsahi
Copy link
Contributor

MohammadAliAfsahi commented May 10, 2024

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
Copy link
Member

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
Copy link
Contributor

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
Copy link
Contributor

MohammadAliAfsahi commented May 10, 2024

@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
Copy link
Member

@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
Copy link
Contributor

@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
Copy link
Member

ErikBjare commented May 10, 2024 via email

@ErikBjare
Copy link
Member

ErikBjare commented May 11, 2024

I fixed the issue where the aw-server build failed silently, causing the later error: 0520dd0

Will also update the docs.

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

3 participants