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

ModuleNotFoundError: No module named 'semantra.semantra'; 'semantra' is not a package #43

Closed
madhurimamandal opened this issue Jun 6, 2023 · 1 comment

Comments

@madhurimamandal
Copy link

madhurimamandal commented Jun 6, 2023

I am trying to run the src/semantra.py file directly after cloning this repo, and I am getting the following error, kindly let me know how to mitigate this.: -

  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/home/madhurima/semantra/src/semantra/semantra.py", line 650, in base
    pkg_resources.resource_filename("semantra.semantra", "client_public"),
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1211, in resource_filename
    return get_provider(package_or_requirement).get_resource_filename(
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 402, in get_provider
    __import__(moduleOrReq)


ModuleNotFoundError: No module named 'semantra.semantra'; 'semantra' is not a package


125.18.52.138 - - [06/Jun/2023 16:28:02] "GET / HTTP/1.1" 500 -
[2023-06-06 16:28:02,714] ERROR in app: Exception on /favicon.ico [GET]
Traceback (most recent call last):
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/home/madhurima/semantra/src/semantra/semantra.py", line 658, in home
    pkg_resources.resource_filename("semantra.semantra", "client_public"),
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1211, in resource_filename
    return get_provider(package_or_requirement).get_resource_filename(
  File "/rapid_data/miniconda/envs/sem_9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 402, in get_provider
    __import__(moduleOrReq)

ModuleNotFoundError: No module named 'semantra.semantra'; 'semantra' is not a package```
@freedmand
Copy link
Owner

Hi there! Semantra is intended to be installed via pipx, but if you wish to develop locally then you can follow these steps:

  • clone the repo
  • create a new virtual environment
  • run pip install -e .
  • now you can just run semantra in the command-line followed by whatever arguments you wish to apply

These steps will allow you to run Semantra on the locally cloned repo. Running semantra <args> will effectively run python src/semantra.py with the modules set up correctly.

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