其他分享
首页 > 其他分享> > 导入问题Zope.deprecation

导入问题Zope.deprecation

作者:互联网

我正在尝试使用新的Pyramid framework构建应用程序.我对Pyramid并不陌生,不知道Zope的用途(其重要性将变得显而易见).我遵循了基础教程,但是当我尝试运行该应用程序时,我得到了回溯:

Traceback (most recent call last):
  File "tasks.py", line 4, in <module>
    from pyramid.config import Configurator
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyramid-1.2-py2.6.egg/pyramid/__init__.py", line 1, in <module>
    from pyramid.request import Request
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyramid-1.2-py2.6.egg/pyramid/request.py", line 1, in <module>
    from zope.deprecation import deprecate
ImportError: No module named deprecation

我尝试使用setuptools安装Pyramid:

sudo easy_install pyramid

其中,在许多其他输出中包括:

Searching for zope.deprecation
Reading http://pypi.python.org/simple/zope.deprecation/
Best match: zope.deprecation 3.5.0
Downloading http://pypi.python.org/packages/source/z/zope.deprecation/zope.deprecation-3.5.0.tar.gz#md5=1e7db82583013127aab3e7e790b1f2b6
Processing zope.deprecation-3.5.0.tar.gz
Running zope.deprecation-3.5.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ZiLy8j/zope.deprecation-3.5.0/egg-dist-tmp-yGFSor
Adding zope.deprecation 3.5.0 to easy-install.pth file

我认为应该涵盖它.

我也尝试通过macports安装zope:

sudo port install zope

sudo port install py26-zopeinterface

我也曾尝试在运行脚本之前运行sudo port load zope,但那里没有帮助.

我还尝试从http://pypi.python.org/pypi/zope.interface下载源代码并在目录中手动构建它.

有什么想法我做错了吗?

– – 编辑 – –

一种猜测是setuptools将其zope组件安装到系统的默认Python框架(这是一个Enthought发行版)中,但是我的默认python环境是Macports安装的环境,因此Macports zope模块可能具有一些但不是全部组件,例如zope.deprecate.

解决方法:

您可能会从更熟悉Pyramid的人那里得到答案,但是这里的问题是pyramid.request取决于zope.deprecation,并且它尚未安装/不可用.您必须详细说明“我尝试使用…安装zope”,以便为您提供更多帮助.

确保从安装时使用的同一Python运行金字塔.如果是这种情况,则应该在此处安装zope.deprecation软件包.您从python -c“ import zope.deprecation; print import zope.deprecation”中得到什么?

标签:zope,pylons,python
来源: https://codeday.me/bug/20191102/1989576.html