在 django 中同步新的 BeautifulSoup 包时出现问题

发布于 2024-11-09 06:44:22 字数 1787 浏览 0 评论 0原文

这是回溯,请帮忙。

   Traceback (most recent call last):
      File "C:\Documents and Settings\EC.32-SAMUEL\workspace\ec\ec\manage.py", line 11, in <module>
        execute_manager(settings)
      File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 438, in execute_manager
        utility.execute()
      File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 379, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "C:\Python26\lib\site-packages\django\core\management\base.py", line 191, in run_from_argv
        self.execute(*args, **options.__dict__)
      File "C:\Python26\lib\site-packages\django\core\management\base.py", line 219, in execute
        self.validate()
      File "C:\Python26\lib\site-packages\django\core\management\base.py", line 249, in validate
        num_errors = get_validation_errors(s, app)
      File "C:\Python26\lib\site-packages\django\core\management\validation.py", line 36, in get_validation_errors
        for (app_name, error) in get_app_errors().items():
      File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 146, in get_app_errors
        self._populate()
      File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 61, in _populate
        self.load_app(app_name, True)
      File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 83, in load_app
        if not module_has_submodule(app_module, 'models'):
      File "C:\Python26\lib\site-packages\django\utils\module_loading.py", line 17, in module_has_submodule
        for entry in package.__path__:  # No __path__, then not a package.
    AttributeError: 'module' object has no attribute '

路径'

This was the traceback, please help.

   Traceback (most recent call last):
      File "C:\Documents and Settings\EC.32-SAMUEL\workspace\ec\ec\manage.py", line 11, in <module>
        execute_manager(settings)
      File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 438, in execute_manager
        utility.execute()
      File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 379, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "C:\Python26\lib\site-packages\django\core\management\base.py", line 191, in run_from_argv
        self.execute(*args, **options.__dict__)
      File "C:\Python26\lib\site-packages\django\core\management\base.py", line 219, in execute
        self.validate()
      File "C:\Python26\lib\site-packages\django\core\management\base.py", line 249, in validate
        num_errors = get_validation_errors(s, app)
      File "C:\Python26\lib\site-packages\django\core\management\validation.py", line 36, in get_validation_errors
        for (app_name, error) in get_app_errors().items():
      File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 146, in get_app_errors
        self._populate()
      File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 61, in _populate
        self.load_app(app_name, True)
      File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 83, in load_app
        if not module_has_submodule(app_module, 'models'):
      File "C:\Python26\lib\site-packages\django\utils\module_loading.py", line 17, in module_has_submodule
        for entry in package.__path__:  # No __path__, then not a package.
    AttributeError: 'module' object has no attribute '

path'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

自由范儿 2024-11-16 06:44:22

BeautifulSoup 不是 Django 应用程序。它是一个 python 包/模块。您不必添加到 INSTALLED_APPS。只需要在 PYTHONPATH 中可用即可使用它。

您的回溯并没有给出 Django 项目实际问题所在的线索。

BeautifulSoup is not a Django-app. Its a python package/module. You don't have to add to INSTALLED_APPS. It just need to be available in your PYTHONPATH to use it.

Your traceback doesn't give clue what is actually wrong with your Django project.

指尖上的星空 2024-11-16 06:44:22

唯一需要执行同步数据库的时候是当您必须对数据库执行某些操作时。 BeautifulSoup 在任何时候都不需要使用数据库,也不需要是已安装的应用程序

The only time you ever need to do a syncdb is when you have to do something to the db. BeautifulSoup does not need to use the db at any point and does not need to be an installed app

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文