sei-ec-remote / team-project-issues

0 stars 0 forks source link

NameError when staring local server #163

Closed noahD0zer closed 1 year ago

noahD0zer commented 1 year ago

Describe the bug A clear and concise description of what the bug is. "NameError: name 'Path' is not defined" when running runserver command It refrences line 20 of settings.py, Path is imported above the line in question. double checked git pull's were not neccessary, files match groupmates.

What is the problem you are trying to solve?

Expected behavior A clear and concise description of what you expected to happen. Other groupmates are not experiencing this issue/groupmates servers start without issue.

What is the actual behavior? A clear and concise description of what actually happened.

Post any code you think might be relevant (one fenced block per file)

Traceback (most recent call last):
  File "/Users/noahmendoza/sei/djangoenv/teacheasy/manage.py", line 22, in <module>
    main()
  File "/Users/noahmendoza/sei/djangoenv/teacheasy/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/django/core/management/__init__.py", line 382, in execute
    settings.INSTALLED_APPS
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/django/conf/__init__.py", line 102, in __getattr__
    self._setup(name)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/django/conf/__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/django/conf/__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/noahmendoza/sei/djangoenv/teacheasy/teacheasy/settings.py", line 20, in <module>
    BASE_DIR = Path(__file__).resolve().parent.parent
               ^^^^
NameError: name 'Path' is not defined
from pathlib import Path
import environ

environ.Env()
environ.Env.read_env()

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

What is your best guess as to the source of the problem? maybe path is not installed on django?

What things have you already tried to solve the problem? ran pip3 install path made sure git pull's were up to date and files are current with groupmates.

Additional context Add any other context about the problem here.

Paste a link to your repository here https://github.com/noahD0zer/teacheasy

asands94 commented 1 year ago

Are you currently in your virtual environment when you try to run the server?

noahD0zer commented 1 year ago

yes

asands94 commented 1 year ago

try running python3 manage.py runserver

noahD0zer commented 1 year ago

still not working unfortunately