0

ピラミッドを実行しようとすると

[~/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

これをどのように解決すればよいですか?


これは私がインストールするためにしたことです

$ mkdir opt
$ cd opt
$ wget http://python.org/ftp/python/3.2.3/Python-3.2.3.tgz 
$ tar -xzf Python-3.2.3.tgz
$ cd Python-3.2.3

./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

わかりました。ピラミッドドキュメント(http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/paste.html)を検索しました。それは3番目の段落に述べています

「ただし、すべてのPyramidスキャフォールドはPasteDeploy構成ファイルをレンダリングし、新しい開発者にデプロイメント値を設定する標準化された方法を提供し、新しいユーザーにアプリケーションの開始、停止、およびデバッグの標準化された方法を提供します。」

そこで、development.iniに変更を加えて、置き換えました

[server:main]
use = egg:waitress#main

setup.pyで、requires配列に「waitress」を追加しました

次のステップでは、/ 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'

なんらかの理由でpyramid1.4にはペーストが必要なようです。おそらく誰かがこれについていくつかの洞察を持っています。

4

1 に答える 1

1

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

同じフォルダーで、setup.py に必要な変更を加えます。

    1. requires = [....], add in waitress into the array, remove WebError from the array
    2. remove paster_plugins=['pyramid']

そして最後に、実行します

    $ ../bin/python setup.py develop

Paste はインストールされず、存在してもチェックされません。

于 2013-03-18T07:06:51.103 に答える