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

Added poetry toml and lock files #34

Closed
wants to merge 1 commit into from

Conversation

Upasanadhameliya
Copy link
Contributor

Closes #31

What?

The pyproject.toml describes the main packages that wagtail project will
be using.

The poetry.lock file defines all the dependent libraries and extras that
the project needs. .lock file is created from the .toml file.

Usage

To create a virtual environment run poetry install

The .toml describes the main packages that wagtail project will
be using.

The .lock file defines all the dependent libraries and extras that
the project needs. .lock file is created from the .toml file
Copy link
Collaborator

@brylie brylie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Is it ready for review?

Please add some comments to our README describing that Poetry is a dependency, e.g. with a link to the Poetry installation docs and commands to run the environment.

@Upasanadhameliya
Copy link
Contributor Author

Upasanadhameliya commented Sep 30, 2021

@brylie The pyproject and the lock files are good enough and I do want to make it ready for review, however, I am facing a major issue. You see when I run poetry install I run into the following issue. I have been struggling on it for quite a while now and haven't got much leads on how to solve it. I run it on Anaconda Prompt with Windows 10 OS:

Show stack trace
(base) D:\upa\comp\projects\demo\wagtail\wagtail-social-network>poetry install -vvv
Using virtualenv: D:\upa\comp\projects\demo\wagtail\virtualenvs\wagtail-social-network-z4ToQI37-py3.8
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 42 installs, 0 updates, 0 removals

  • Installing asgiref (3.4.1)
  • Installing et-xmlfile (1.1.0)
  • Installing pytz (2021.1)
  • Installing sqlparse (0.4.2)

  Stack trace:

  6  ~\.poetry\lib\poetry\installation\executor.py:202 in _execute_operation
      200│
      201│             try:
    → 202│                 result = self._do_execute_operation(operation)
      203│             except EnvCommandError as e:
      204│                 if e.e.returncode == -2:

  5  ~\.poetry\lib\poetry\installation\executor.py:276 in _do_execute_operation
      274│             return 0
      275│
    → 276│         result = getattr(self, "_execute_{}".format(method))(operation)
      277│
      278│         if result != 0:

  4  ~\.poetry\lib\poetry\installation\executor.py:411 in _execute_install
      409│
      410│     def _execute_install(self, operation):  # type: (Install) -> None
    → 411│         return self._install(operation)
      412│
      413│     def _execute_update(self, operation):  # type: (Update) -> None

  3  ~\.poetry\lib\poetry\installation\executor.py:437 in _install
      435│             archive = self._download_link(operation, Link(package.source_url))
      436│         else:
    → 437│             archive = self._download(operation)
      438│
      439│         operation_message = self.get_operation_message(operation)

  2  ~\.poetry\lib\poetry\installation\executor.py:585 in _download
      583│         link = self._chooser.choose_for(operation.package)
      584│
    → 585│         return self._download_link(operation, link)
      586│
      587│     def _download_link(self, operation, link):

  1  ~\.poetry\lib\poetry\installation\executor.py:618 in _download_link
      616│                     "{}:{}".format(
      617│                         hash_type,
    → 618│                         FileDependency(
      619│                             package.name,
      620│                             Path(archive.path)

  ValueError

  File \C:\Users\Upasana Dhameliya\AppData\Local\pypoetry\Cache\artifacts\3f\98\4d\6a033cf821463ecb706293158c40bcde94048c2f69eee1ba0354d1b42f\asgiref-3.4.1-py3-none-any.whl does not exist

  at ~\.poetry\lib\poetry\_vendor\py3.8\poetry\core\packages\file_dependency.py:40 in __init__
       36│             except FileNotFoundError:
       37│                 raise ValueError("Directory {} does not exist".format(self._path))
       38│
       39│         if not self._full_path.exists():
    →  40│             raise ValueError("File {} does not exist".format(self._path))
       41│
       42│         if self._full_path.is_dir():
       43│             raise ValueError("{} is a directory, expected a file".format(self._path))
       44│


  Stack trace:

  6  ~\.poetry\lib\poetry\installation\executor.py:202 in _execute_operation
      200│
      201│             try:
    → 202│                 result = self._do_execute_operation(operation)
      203│             except EnvCommandError as e:
      204│                 if e.e.returncode == -2:

  5  ~\.poetry\lib\poetry\installation\executor.py:276 in _do_execute_operation
      274│             return 0
      275│
    → 276│         result = getattr(self, "_execute_{}".format(method))(operation)
      277│
      278│         if result != 0:

  4  ~\.poetry\lib\poetry\installation\executor.py:411 in _execute_install
      409│
      410│     def _execute_install(self, operation):  # type: (Install) -> None
    → 411│         return self._install(operation)
      412│
      413│     def _execute_update(self, operation):  # type: (Update) -> None

  3  ~\.poetry\lib\poetry\installation\executor.py:437 in _install
      435│             archive = self._download_link(operation, Link(package.source_url))
      436│         else:
    → 437│             archive = self._download(operation)
      438│
      439│         operation_message = self.get_operation_message(operation)

  2  ~\.poetry\lib\poetry\installation\executor.py:585 in _download
      583│         link = self._chooser.choose_for(operation.package)
      584│
    → 585│         return self._download_link(operation, link)
      586│
      587│     def _download_link(self, operation, link):

  1  ~\.poetry\lib\poetry\installation\executor.py:618 in _download_link
      616│                     "{}:{}".format(
      617│                         hash_type,
    → 618│                         FileDependency(
      619│                             package.name,
      620│                             Path(archive.path)

  ValueError

  File \C:\Users\Upasana Dhameliya\AppData\Local\pypoetry\Cache\artifacts\bd\30\d0\940567a036c6ea57abe7098acbd123f8c8985ccc27713365ae80d28f89\sqlparse-0.4.2-py3-none-any.whl does not exist

  at ~\.poetry\lib\poetry\_vendor\py3.8\poetry\core\packages\file_dependency.py:40 in __init__
       36│             except FileNotFoundError:
       37│                 raise ValueError("Directory {} does not exist".format(self._path))
       38│
       39│         if not self._full_path.exists():
    →  40│             raise ValueError("File {} does not exist".format(self._path))
       41│
       42│         if self._full_path.is_dir():
       43│             raise ValueError("{} is a directory, expected a file".format(self._path))
       44│


  Stack trace:

  6  ~\.poetry\lib\poetry\installation\executor.py:202 in _execute_operation
      200│
      201│             try:
    → 202│                 result = self._do_execute_operation(operation)
      203│             except EnvCommandError as e:
      204│                 if e.e.returncode == -2:

  5  ~\.poetry\lib\poetry\installation\executor.py:276 in _do_execute_operation
      274│             return 0
      275│
    → 276│         result = getattr(self, "_execute_{}".format(method))(operation)
      277│
      278│         if result != 0:

  4  ~\.poetry\lib\poetry\installation\executor.py:411 in _execute_install
      409│
      410│     def _execute_install(self, operation):  # type: (Install) -> None
    → 411│         return self._install(operation)
      412│
      413│     def _execute_update(self, operation):  # type: (Update) -> None

  3  ~\.poetry\lib\poetry\installation\executor.py:437 in _install
      435│             archive = self._download_link(operation, Link(package.source_url))
      436│         else:
    → 437│             archive = self._download(operation)
      438│
      439│         operation_message = self.get_operation_message(operation)

  2  ~\.poetry\lib\poetry\installation\executor.py:585 in _download
      583│         link = self._chooser.choose_for(operation.package)
      584│
    → 585│         return self._download_link(operation, link)
      586│
      587│     def _download_link(self, operation, link):

  1  ~\.poetry\lib\poetry\installation\executor.py:618 in _download_link
      616│                     "{}:{}".format(
      617│                         hash_type,
    → 618│                         FileDependency(
      619│                             package.name,
      620│                             Path(archive.path)

  ValueError

  File \C:\Users\Upasana Dhameliya\AppData\Local\pypoetry\Cache\artifacts\54\fd\16\7449f65d172d97e10b198adf308f9254ed6c37e55795a24184502b4883\et_xmlfile-1.1.0-py3-none-any.whl does not exist

  at ~\.poetry\lib\poetry\_vendor\py3.8\poetry\core\packages\file_dependency.py:40 in __init__
       36│             except FileNotFoundError:
       37│                 raise ValueError("Directory {} does not exist".format(self._path))
       38│
       39│         if not self._full_path.exists():
    →  40│             raise ValueError("File {} does not exist".format(self._path))
       41│
       42│         if self._full_path.is_dir():
       43│             raise ValueError("{} is a directory, expected a file".format(self._path))
       44│


  Stack trace:

  6  ~\.poetry\lib\poetry\installation\executor.py:202 in _execute_operation
      200│
      201│             try:
    → 202│                 result = self._do_execute_operation(operation)
      203│             except EnvCommandError as e:
      204│                 if e.e.returncode == -2:

  5  ~\.poetry\lib\poetry\installation\executor.py:276 in _do_execute_operation
      274│             return 0
      275│
    → 276│         result = getattr(self, "_execute_{}".format(method))(operation)
      277│
      278│         if result != 0:

  4  ~\.poetry\lib\poetry\installation\executor.py:411 in _execute_install
      409│
      410│     def _execute_install(self, operation):  # type: (Install) -> None
    → 411│         return self._install(operation)
      412│
      413│     def _execute_update(self, operation):  # type: (Update) -> None

  3  ~\.poetry\lib\poetry\installation\executor.py:437 in _install
      435│             archive = self._download_link(operation, Link(package.source_url))
      436│         else:
    → 437│             archive = self._download(operation)
      438│
      439│         operation_message = self.get_operation_message(operation)

  2  ~\.poetry\lib\poetry\installation\executor.py:585 in _download
      583│         link = self._chooser.choose_for(operation.package)
      584│
    → 585│         return self._download_link(operation, link)
      586│
      587│     def _download_link(self, operation, link):

  1  ~\.poetry\lib\poetry\installation\executor.py:618 in _download_link
      616│                     "{}:{}".format(
      617│                         hash_type,
    → 618│                         FileDependency(
      619│                             package.name,
      620│                             Path(archive.path)

  ValueError

  File \C:\Users\Upasana Dhameliya\AppData\Local\pypoetry\Cache\artifacts\19\50\c9\f8bffb0360052b3c85b912bc4172f824bc2571e24002806fb3a428302e\pytz-2021.1-py2.py3-none-any.whl does not exist

  at ~\.poetry\lib\poetry\_vendor\py3.8\poetry\core\packages\file_dependency.py:40 in __init__
       36│             except FileNotFoundError:
       37│                 raise ValueError("Directory {} does not exist".format(self._path))
       38│
       39│         if not self._full_path.exists():
    →  40│             raise ValueError("File {} does not exist".format(self._path))
       41│
       42│         if self._full_path.is_dir():
       43│             raise ValueError("{} is a directory, expected a file".format(self._path))
       44│

@Upasanadhameliya
Copy link
Contributor Author

I have even tried updating poetry and even changing the configuration path of the virtualenv , yet still haven't met with success. If you run poetry install in your environment are you able to create the venv for the lock file that I have created?

@brylie
Copy link
Collaborator

brylie commented Sep 30, 2021

@Upasanadhameliya, the Poetry settings you provide here work for me (using Python 3.9.5). I'm not sure of the underlying issue here, but it may be more related to Anaconda than Poetry. Anecdotally, I have stopped using Anaconda because of similar issues to this. Are you able to test with a standard Python installation, rather than Anaconda?

Copy link
Collaborator

@brylie brylie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing would be to add a file called poetry.toml containing the following code:

[virtualenvs]
in-project = true

This will create the virtual environment directly within the project, in env, which makes it easier to find.

@Upasanadhameliya
Copy link
Contributor Author

Upasanadhameliya commented Oct 1, 2021

@brylie Apparently my problem was poetry related and was faced by many users recently. Might be a new bug in poetry. Solved the issue using the reference links:

https://stackoverflow.com/questions/69326748/poetry-install-command-fails-whl-files-are-not-found
python-poetry/poetry#4163 (comment)

@brylie
Copy link
Collaborator

brylie commented Oct 1, 2021

@Upasanadhameliya, good find!

Go ahead and add the poetry.toml settings and we can merge this PR 😃 (after you take it out of "draft" mode.)

@Upasanadhameliya
Copy link
Contributor Author

Upasanadhameliya commented Oct 1, 2021

@brylie The thing is that with the virtual environment activated, I am still facing errors. I tried using two python versions.
So I am trying to debug these things before I open the PR for merging.

Python 3.8.8 error
(.venv) D:\upa\comp\projects\demo\wagtail\wagtail-social-network\project>python39 manage.py runserver
Traceback (most recent call last):
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\project\manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

(.venv) D:\upa\comp\projects\demo\wagtail\wagtail-social-network\project>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\ProgramData\Anaconda3\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run
    autoreload.raise_last_exception()
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\core\management\__init__.py", line 375, in execute
    autoreload.check_errors(django.setup)()
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\apps\registry.py", line 114, in populate
    app_config.import_models()
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\apps\config.py", line 301, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\project\accounts\models.py", line 2, in <module>
    from django.contrib.auth.models import AbstractUser
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\contrib\auth\models.py", line 3, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\contrib\auth\base_user.py", line 48, in <module>
    class AbstractBaseUser(models.Model):
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\models\base.py", line 122, in __new__
    new_class.add_to_class('_meta', Options(meta, app_label))
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\models\base.py", line 326, in add_to_class
    value.contribute_to_class(cls, name)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\models\options.py", line 207, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\utils\connection.py", line 15, in __getattr__
    return getattr(self._connections[self._alias], item)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\utils\connection.py", line 62, in __getitem__
    conn = self.create_connection(alias)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\utils.py", line 204, in create_connection
    backend = load_backend(db['ENGINE'])
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\utils.py", line 111, in load_backend
    return import_module('%s.base' % backend_name)
  File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\backends\sqlite3\base.py", line 15, in <module>
    from sqlite3 import dbapi2 as Database
  File "C:\ProgramData\Anaconda3\lib\sqlite3\__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "C:\ProgramData\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: DLL load failed while importing _sqlite3: The specified module could not be found.
Python 3.9.7 error
(.venv) D:\upa\comp\projects\demo\wagtail\wagtail-social-network\project>python39 manage.py runserver
Traceback (most recent call last):
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\project\manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

@brylie
Copy link
Collaborator

brylie commented Oct 1, 2021

ModuleNotFoundError: No module named 'django'

Did you do a poetry install after running poetry shell?

Also, make the requested change to add poetry.toml, then run poetry shell and poetry install again. That will create the virtual environment in the project directory, so you can easily look inside to make sure the dependencies are installed correctly.

@Upasanadhameliya
Copy link
Contributor Author

@brylie I ran both those commands and made the requested change to poetry.toml as well.. Still no luck with the code.. Getting the same error..

Python 3.8.8 error
(.venv) D:\upa\comp\projects\demo\wagtail\wagtail-social-network\project>poetry shell
Virtual environment already activated: D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv

(.venv) D:\upa\comp\projects\demo\wagtail\wagtail-social-network\project>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\ProgramData\Anaconda3\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run
    autoreload.raise_last_exception()
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\core\management\__init__.py", line 375, in execute
    autoreload.check_errors(django.setup)()
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\apps\registry.py", line 114, in populate
    app_config.import_models()
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\apps\config.py", line 301, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\project\accounts\models.py", line 2, in <module>
    from django.contrib.auth.models import AbstractUser
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\contrib\auth\models.py", line 3, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\contrib\auth\base_user.py", line 48, in <module>
    class AbstractBaseUser(models.Model):
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\models\base.py", line 122, in __new__
    new_class.add_to_class('_meta', Options(meta, app_label))
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\models\base.py", line 326, in add_to_class
    value.contribute_to_class(cls, name)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\models\options.py", line 207, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\utils\connection.py", line 15, in __getattr__
    return getattr(self._connections[self._alias], item)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\utils\connection.py", line 62, in __getitem__
    conn = self.create_connection(alias)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\utils.py", line 204, in create_connection
    backend = load_backend(db['ENGINE'])
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\utils.py", line 111, in load_backend
    return import_module('%s.base' % backend_name)
  File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "D:\upa\comp\projects\demo\wagtail\wagtail-social-network\.venv\lib\site-packages\django\db\backends\sqlite3\base.py", line 15, in <module>
    from sqlite3 import dbapi2 as Database
  File "C:\ProgramData\Anaconda3\lib\sqlite3\__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "C:\ProgramData\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: DLL load failed while importing _sqlite3: The specified module could not be found.

@brylie
Copy link
Collaborator

brylie commented Oct 6, 2021

Can you try without Anaconda? There are other developers with the same issue related to Anaconda and sqlite on Windows:

https://stackoverflow.com/questions/54876404/unable-to-import-sqlite3-using-anaconda-python

@Upasanadhameliya
Copy link
Contributor Author

@brylie I tried it using simple command prompt.. Despite that I am getting the same exact errors as this issue

@brylie
Copy link
Collaborator

brylie commented Oct 6, 2021

In the Python 3.9.7 example you linked to above, I see the error:

ModuleNotFoundError: No module named 'django'

That error is telling us the virtual environment doesn't have the dependencies installed. I think that is the expected result in any new virtual environment. We would typically need to run pip install -r requirements.txt to install django and other dependencies needed by the manage.py runserver command.

Can you share the exact commands you used to create the Python 3.9.7 virtual environment and install the dependencies before running the python manage.py runserver command?

I still believe the Python 3.8.8 problem is Anaconda-related.

@brylie
Copy link
Collaborator

brylie commented Oct 6, 2021

In any case, we can come back to this task later. The project works pretty well without Poetry. I was just hoping that Poetry would improve the developer experience instead of making it harder to create the environment :-)

@brylie
Copy link
Collaborator

brylie commented Oct 6, 2021

I'm sorry that the switch to Poetry raised so many environment errors. Thanks for sticking with the idea and trying to get it working. Shall we close the pull request for now and focus on building some feature(s)?

@Upasanadhameliya
Copy link
Contributor Author

@brylie Sure, It was good to learn about Poetry anyhow.. And just like you said it was supposed to make it easier but it didn't work out.. We can come back to the same issue in the future if required.. Closing the Draft PR for now 😄

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

Successfully merging this pull request may close these issues.

Switch to Poetry for dependency management
2 participants