Python ImportError:没有名为rfc822的模块

Python ImportError:没有名为rfc822的模块,python,pyramid,Python,Pyramid,当我尝试运行金字塔时 [~/env/MyStore]# ../bin/pserve development.ini 它将显示以下错误 File "/home/vretinfo/env/lib/python3.2/site-packages/Paste-1.7.5.1-py3.2.egg/paste/fileapp.py", line 14, in <module> from paste.httpheaders import * File "/home/vretinfo/en

当我尝试运行金字塔时

[~/env/MyStore]# ../bin/pserve development.ini
它将显示以下错误

File "/home/vretinfo/env/lib/python3.2/site-packages/Paste-1.7.5.1-py3.2.egg/paste/fileapp.py", line 14, in <module>
    from paste.httpheaders import *
File "/home/vretinfo/env/lib/python3.2/site-packages/Paste-1.7.5.1-py3.2.egg/paste/httpheaders.py", line 140, in <module>
    from rfc822 import formatdate, parsedate_tz, mktime_tz
ImportError: No module named rfc822
./configure--prefix=$HOME/opt/Python-3.2.3

$ make; 
$ make install
$ cd ~
$ wget http://python-distribute.org/distribute_setup.py
$ pico distribute_setup.py
* change first line to opt/Python-3.2.3/python
$ opt/Python-3.2.3/bin/python3.2 distribute_setup.py
$ opt/Python-3.2.3/bin/easy_install virtualenv
$ opt/Python-3.2.3/bin/virtualenv --no-site-packages env
$ cd env
$ ./bin/pip install passlib
$ ./bin/pip install pyramid_beaker
$ ./bin/pip install pyramid_mailer
$ ./bin/pip install pyramid_mongodb
$ ./bin/pip install pyramid_jinja2
$ ./bin/pip install Werkzeug
$ ./bin/pip install pyramid 
$ ./bin/pcreate -s pyramid_mongodb MyShop
$ cd MyShop
$ ../bin/python setup.py develop
$ ../bin/python setup.py test -q

好的,我在金字塔文档()上做了一些搜索。 它在第3段中说明

但是,所有金字塔框架都呈现粘贴部署配置文件,为新开发人员提供设置部署值的标准方法,并为新用户提供启动、停止和调试应用程序的标准方法

因此,我对development.ini进行了更改并替换了

[server:main]
use = egg:waitress#main
在setup.py中,我将“waiteress”添加到requires数组中

下一步,我在/home/vretinfo/env/ECommerce/中完全删除了与粘贴相关的所有内容

$ rm -rf Paste*;rm -rf paste*
在此之后,我再次尝试运行test-q,这是堆栈跟踪:

[~/env/ECommerce]# ../bin/python setup.py test -q

/home/vretinfo/opt/Python-3.2.3/lib/python3.2/distutils/dist.py:257: UserWarning: Unknown distribution option: 'paster_plugins'
warnings.warn(msg)
running test
Checking .pth file support in .
/home/vretinfo/env/ECommerce/../bin/python -E -c pass
Searching for Paste>=1.7.1
Reading http://pypi.python.org/simple/Paste/
Reading http://pythonpaste.org
Best match: Paste 1.7.5.1
Downloading http://pypi.python.org/packages/source/P/Paste/Paste-1.7.5.1.tar.gz#md5=7ea5fabed7dca48eb46dc613c4b6c4ed
Processing Paste-1.7.5.1.tar.gz
Writing /tmp/easy_install-q5h5rn/Paste-1.7.5.1/setup.cfg
Running Paste-1.7.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-q5h5rn/Paste-1.7.5.1/egg-dist-tmp-e3nvmj
warning: no previously-included files matching '*' found under directory 'docs/_build/_sources'

出于某种原因,金字塔1.4似乎需要粘贴。也许有人对此有一些见解。

我已经设法通过IRC#pyramid中的人员解决了这个问题。我在这里发布解决方案,以防将来有人遇到。我已经在Python3.2中对此进行了测试,现在一切正常

运行后。/bin/pcreate-s

在项目的文件夹中,development.ini

更改以下内容:

    1. in the 1st line, rename [app:<Project>] to [app:main]

    2. [server:main]
       If it is egg:Paste#http, change it to

       use = egg:waitress#main

    3. remove [pipeline:main] and its section
最后,跑

    $ ../bin/python setup.py develop

如果存在粘贴,则不会安装或检查它。

考虑到您使用标准配置选项构建python,请尝试
ls/usr/lib/python3.2 | grep“rfc822”
。您在那里的输出是什么?@eazar001:该模块已在Python 3中删除。Paste与Python3不兼容,我很惊讶看到它被使用。这是什么版本的Pyramid?
Paste
依赖项在几个版本之前就被删除了,因为它在Python 3上不起作用。我很惊讶地看到它也被安装了,因为我只是按照中的安装说明进行安装,我在从头开始安装pyramid的步骤中添加了这些说明
    1. requires = [....], add in waitress into the array, remove WebError from the array
    2. remove paster_plugins=['pyramid']
    $ ../bin/python setup.py develop