[Django]ImportError:cannot import name debug问题

[Django]ImportError:cannot import name debug问题

Version

Date

Creator

Description

1.0.0 .1

2007-1-10

郑昀

草稿

继续阅读之前,我们假设您熟悉以下知识:

n         Python

n         Django

n         Apache

 

浏览着架设在Apache 2.2.3 (mod_python-3.2.10)上的Django应用,突然出现这样的错误,而且刷新也没用:

页面输出

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "C:/Python24/Lib/site-packages/mod_python/apache.py", line 299, in HandlerDispatch

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 163, in handler

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 136, in __call__

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 102, in get_response

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 130, in get_technical_error_response

ImportError: cannot import name debug

 

四处寻觅解决办法,在

http://www.modpython.org/FAQ/faqw.py?req=all#2.12

也有人报告了类似问题:

类似报告

2.12. [error] SOLUTION PythonHandler mod_python.psp: ImportError: No module named psp

SOLVED

I had the same problem in 3.0.3 on UNIX and it appears to be fixed by updating to 3.1.3

------ mrez adds:

I'm having the same problem too:

Debug text: Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 326, in HandlerDispatch

    log=debug)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 496, in import_module

    module = imp.load_module(mname, f, p, d)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/psp.py", line 59, in ?

    import apache, Session, util, _psp

ImportError: DLL load failed: The specified module could not be found.

 

在这个页面的2.2小节,提及了解决方案:

增加的配置行

If you see a Python exception of the form:

  ImportError: No module named _apache

it means that you have mod_python version 3.1. If you see the Python exception:

  ImportError: No module named psp

it means that you only have version 2.7. Finally, if you instead see the Python exception:

  ImportError: No module named mod_python.psp

it means that mod_python isn't installed after all, or at least not for the version of Python you are trying to use.

看来和我遇到的还不一样。

重启Apache server就好了。但有一就有二,下次它还会来的。

 


[Django]ImportError:cannot import name debug问题

Version

Date

Creator

Description

1.0.0 .1

2007-1-10

郑昀

草稿

继续阅读之前,我们假设您熟悉以下知识:

n         Python

n         Django

n         Apache

 

浏览着架设在Apache 2.2.3 (mod_python-3.2.10)上的Django应用,突然出现这样的错误,而且刷新也没用:

页面输出

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "C:/Python24/Lib/site-packages/mod_python/apache.py", line 299, in HandlerDispatch

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 163, in handler

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 136, in __call__

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 102, in get_response

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 130, in get_technical_error_response

ImportError: cannot import name debug

 

四处寻觅解决办法,在

http://www.modpython.org/FAQ/faqw.py?req=all#2.12

也有人报告了类似问题:

类似报告

2.12. [error] SOLUTION PythonHandler mod_python.psp: ImportError: No module named psp

SOLVED

I had the same problem in 3.0.3 on UNIX and it appears to be fixed by updating to 3.1.3

------ mrez adds:

I'm having the same problem too:

Debug text: Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 326, in HandlerDispatch

    log=debug)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 496, in import_module

    module = imp.load_module(mname, f, p, d)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/psp.py", line 59, in ?

    import apache, Session, util, _psp

ImportError: DLL load failed: The specified module could not be found.

 

在这个页面的2.2小节,提及了解决方案:

增加的配置行

If you see a Python exception of the form:

  ImportError: No module named _apache

it means that you have mod_python version 3.1. If you see the Python exception:

  ImportError: No module named psp

it means that you only have version 2.7. Finally, if you instead see the Python exception:

  ImportError: No module named mod_python.psp

it means that mod_python isn't installed after all, or at least not for the version of Python you are trying to use.

看来和我遇到的还不一样。

重启Apache server就好了。但有一就有二,下次它还会来的。

 


[Django]ImportError:cannot import name debug问题

Version

Date

Creator

Description

1.0.0 .1

2007-1-10

郑昀

草稿

继续阅读之前,我们假设您熟悉以下知识:

n         Python

n         Django

n         Apache

 

浏览着架设在Apache 2.2.3 (mod_python-3.2.10)上的Django应用,突然出现这样的错误,而且刷新也没用:

页面输出

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "C:/Python24/Lib/site-packages/mod_python/apache.py", line 299, in HandlerDispatch

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 163, in handler

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 136, in __call__

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 102, in get_response

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 130, in get_technical_error_response

ImportError: cannot import name debug

 

四处寻觅解决办法,在

http://www.modpython.org/FAQ/faqw.py?req=all#2.12

也有人报告了类似问题:

类似报告

2.12. [error] SOLUTION PythonHandler mod_python.psp: ImportError: No module named psp

SOLVED

I had the same problem in 3.0.3 on UNIX and it appears to be fixed by updating to 3.1.3

------ mrez adds:

I'm having the same problem too:

Debug text: Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 326, in HandlerDispatch

    log=debug)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 496, in import_module

    module = imp.load_module(mname, f, p, d)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/psp.py", line 59, in ?

    import apache, Session, util, _psp

ImportError: DLL load failed: The specified module could not be found.

 

在这个页面的2.2小节,提及了解决方案:

增加的配置行

If you see a Python exception of the form:

  ImportError: No module named _apache

it means that you have mod_python version 3.1. If you see the Python exception:

  ImportError: No module named psp

it means that you only have version 2.7. Finally, if you instead see the Python exception:

  ImportError: No module named mod_python.psp

it means that mod_python isn't installed after all, or at least not for the version of Python you are trying to use.

看来和我遇到的还不一样。

重启Apache server就好了。但有一就有二,下次它还会来的。

 


[Django]ImportError:cannot import name debug问题

Version

Date

Creator

Description

1.0.0 .1

2007-1-10

郑昀

草稿

继续阅读之前,我们假设您熟悉以下知识:

n         Python

n         Django

n         Apache

 

浏览着架设在Apache 2.2.3 (mod_python-3.2.10)上的Django应用,突然出现这样的错误,而且刷新也没用:

页面输出

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "C:/Python24/Lib/site-packages/mod_python/apache.py", line 299, in HandlerDispatch

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 163, in handler

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 136, in __call__

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 102, in get_response

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 130, in get_technical_error_response

ImportError: cannot import name debug

 

四处寻觅解决办法,在

http://www.modpython.org/FAQ/faqw.py?req=all#2.12

也有人报告了类似问题:

类似报告

2.12. [error] SOLUTION PythonHandler mod_python.psp: ImportError: No module named psp

SOLVED

I had the same problem in 3.0.3 on UNIX and it appears to be fixed by updating to 3.1.3

------ mrez adds:

I'm having the same problem too:

Debug text: Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 326, in HandlerDispatch

    log=debug)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 496, in import_module

    module = imp.load_module(mname, f, p, d)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/psp.py", line 59, in ?

    import apache, Session, util, _psp

ImportError: DLL load failed: The specified module could not be found.

 

在这个页面的2.2小节,提及了解决方案:

增加的配置行

If you see a Python exception of the form:

  ImportError: No module named _apache

it means that you have mod_python version 3.1. If you see the Python exception:

  ImportError: No module named psp

it means that you only have version 2.7. Finally, if you instead see the Python exception:

  ImportError: No module named mod_python.psp

it means that mod_python isn't installed after all, or at least not for the version of Python you are trying to use.

看来和我遇到的还不一样。

重启Apache server就好了。但有一就有二,下次它还会来的。

 


[Django]ImportError:cannot import name debug问题

Version

Date

Creator

Description

1.0.0 .1

2007-1-10

郑昀

草稿

继续阅读之前,我们假设您熟悉以下知识:

n         Python

n         Django

n         Apache

 

浏览着架设在Apache 2.2.3 (mod_python-3.2.10)上的Django应用,突然出现这样的错误,而且刷新也没用:

页面输出

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "C:/Python24/Lib/site-packages/mod_python/apache.py", line 299, in HandlerDispatch

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 163, in handler

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 136, in __call__

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 102, in get_response

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 130, in get_technical_error_response

ImportError: cannot import name debug

 

四处寻觅解决办法,在

http://www.modpython.org/FAQ/faqw.py?req=all#2.12

也有人报告了类似问题:

类似报告

2.12. [error] SOLUTION PythonHandler mod_python.psp: ImportError: No module named psp

SOLVED

I had the same problem in 3.0.3 on UNIX and it appears to be fixed by updating to 3.1.3

------ mrez adds:

I'm having the same problem too:

Debug text: Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 326, in HandlerDispatch

    log=debug)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 496, in import_module

    module = imp.load_module(mname, f, p, d)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/psp.py", line 59, in ?

    import apache, Session, util, _psp

ImportError: DLL load failed: The specified module could not be found.

 

在这个页面的2.2小节,提及了解决方案:

增加的配置行

If you see a Python exception of the form:

  ImportError: No module named _apache

it means that you have mod_python version 3.1. If you see the Python exception:

  ImportError: No module named psp

it means that you only have version 2.7. Finally, if you instead see the Python exception:

  ImportError: No module named mod_python.psp

it means that mod_python isn't installed after all, or at least not for the version of Python you are trying to use.

看来和我遇到的还不一样。

重启Apache server就好了。但有一就有二,下次它还会来的。

 


[Django]ImportError:cannot import name debug问题

Version

Date

Creator

Description

1.0.0 .1

2007-1-10

郑昀

草稿

继续阅读之前,我们假设您熟悉以下知识:

n         Python

n         Django

n         Apache

 

浏览着架设在Apache 2.2.3 (mod_python-3.2.10)上的Django应用,突然出现这样的错误,而且刷新也没用:

页面输出

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "C:/Python24/Lib/site-packages/mod_python/apache.py", line 299, in HandlerDispatch

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 163, in handler

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 136, in __call__

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 102, in get_response

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 130, in get_technical_error_response

ImportError: cannot import name debug

 

四处寻觅解决办法,在

http://www.modpython.org/FAQ/faqw.py?req=all#2.12

也有人报告了类似问题:

类似报告

2.12. [error] SOLUTION PythonHandler mod_python.psp: ImportError: No module named psp

SOLVED

I had the same problem in 3.0.3 on UNIX and it appears to be fixed by updating to 3.1.3

------ mrez adds:

I'm having the same problem too:

Debug text: Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 326, in HandlerDispatch

    log=debug)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 496, in import_module

    module = imp.load_module(mname, f, p, d)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/psp.py", line 59, in ?

    import apache, Session, util, _psp

ImportError: DLL load failed: The specified module could not be found.

 

在这个页面的2.2小节,提及了解决方案:

增加的配置行

If you see a Python exception of the form:

  ImportError: No module named _apache

it means that you have mod_python version 3.1. If you see the Python exception:

  ImportError: No module named psp

it means that you only have version 2.7. Finally, if you instead see the Python exception:

  ImportError: No module named mod_python.psp

it means that mod_python isn't installed after all, or at least not for the version of Python you are trying to use.

看来和我遇到的还不一样。

重启Apache server就好了。但有一就有二,下次它还会来的。

 


[Django]ImportError:cannot import name debug问题

Version

Date

Creator

Description

1.0.0 .1

2007-1-10

郑昀

草稿

继续阅读之前,我们假设您熟悉以下知识:

n         Python

n         Django

n         Apache

 

浏览着架设在Apache 2.2.3 (mod_python-3.2.10)上的Django应用,突然出现这样的错误,而且刷新也没用:

页面输出

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "C:/Python24/Lib/site-packages/mod_python/apache.py", line 299, in HandlerDispatch

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 163, in handler

  File "c:/python24/lib/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py", line 136, in __call__

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 102, in get_response

  File "C:/Python24/lib/site-packages/django-0.95-py2.4.egg/django/core/handlers/base.py", line 130, in get_technical_error_response

ImportError: cannot import name debug

 

四处寻觅解决办法,在

http://www.modpython.org/FAQ/faqw.py?req=all#2.12

也有人报告了类似问题:

类似报告

2.12. [error] SOLUTION PythonHandler mod_python.psp: ImportError: No module named psp

SOLVED

I had the same problem in 3.0.3 on UNIX and it appears to be fixed by updating to 3.1.3

------ mrez adds:

I'm having the same problem too:

Debug text: Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 326, in HandlerDispatch

    log=debug)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/apache.py", line 496, in import_module

    module = imp.load_module(mname, f, p, d)

  File "C:/PROGRA~1/PYTHON~1.3/Lib/site-packages/mod_python/psp.py", line 59, in ?

    import apache, Session, util, _psp

ImportError: DLL load failed: The specified module could not be found.

 

在这个页面的2.2小节,提及了解决方案:

增加的配置行

If you see a Python exception of the form:

  ImportError: No module named _apache

it means that you have mod_python version 3.1. If you see the Python exception:

  ImportError: No module named psp

it means that you only have version 2.7. Finally, if you instead see the Python exception:

  ImportError: No module named mod_python.psp

it means that mod_python isn't installed after all, or at least not for the version of Python you are trying to use.

看来和我遇到的还不一样。

重启Apache server就好了。但有一就有二,下次它还会来的。

 


### 解决 Python 中 `ImportError: cannot import name 'geometry'` 错误 当遇到 `ImportError: cannot import name 'geometry'` 这类错误时,通常意味着尝试导入的对象不存在于指定模块中。此类问题可能由多种原因引起,包括但不限于安装包版本不匹配、环境配置不当或对象名称拼写错误。 #### 检查依赖库及其版本 确保所使用的几何处理库已正确安装并处于适当版本。对于涉及 `geometry` 的操作,常见的库有 Shapely 或 GeoPandas。可以通过 pip 安装这些库: ```bash pip install shapely geopandas ``` 确认当前环境中是否存在所需的具体功能模块,并验证其版本是否满足项目需求[^1]。 #### 验证模块内部结构 有时 API 变更可能导致特定函数不再位于预期位置。查阅官方文档以了解最新版次下的命名空间布局变化情况非常重要。例如,在某些情况下,`shapely.geometry` 下的功能可能会被重构到其他地方[^2]。 #### 更新现有软件栈组件 考虑到不同工具间的兼容性差异,保持所有相关联的第三方扩展至最新的稳定发行版有助于减少潜在冲突。特别是针对 Django 用户提到过的类似案例,升级框架本身可能是解决问题的关键一步。可以执行如下命令来完成这一过程: ```bash pip install --upgrade django ``` 这同样适用于任何其它可能存在版本依赖关系的应用程序或中间件[^4]。 #### 修改代码适应变动 如果确实是因为目标属性已被移除或是迁移到了新的路径下造成的无法直接访问的情况,则需调整源码使之符合现行标准定义。比如替换旧有的引用方式为新推荐的形式;或者引入额外的辅助方法间接实现相同目的[^3]。 通过上述措施应该能够有效应对大多数因 “cannot import name” 导致的异常状况。当然具体情况还需具体分析,建议结合实际开发场景灵活运用以上策略加以排查修复。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值