簡體   English   中英

如何使用 anaconda 提示創建具有 python 金字塔 1.2 版本的應用程序?

[英]How to create an application with python pyramid 1.2 version using anaconda prompt?

The steps i followed to create a new project:- I created a new kernel using the command and installed python 3.5 version conda create -n pyramid_kernel python=3.5 Then i activated the kernel conda conda activate pyramid_kernel Then in the directory that i want i navigated and創建了一個虛擬環境並在那里安裝了金字塔版本 1.2

py -m venv tutorial_env 
tutorial_env\Scripts\activate
py -m pip install "pyramid==1.2"

然后我嘗試使用創建一個新項目

paster create -t pyramid_starter foo

但它顯示了一些錯誤:- TypeError:- Class 建議在 python3 中是不可能的。 改用@implementer class 裝飾器

正如其他人在評論中指出的那樣,需要 Python 2.7。 此外,由於版本太舊,並且pyramid==1.2對其依賴項沒有上限,因此也需要固定zope包。 以下 YAML 對我有用:

金字塔內核.yaml

name: pyramid_kernel
channels:
  - conda-forge
dependencies:
  - python=2.7
  - pip
  - pip:
    - pyramid==1.2
    - zope.component==3.6
    - zope.interface==3.5.1

我至少可以確認這使得import pyramid能夠在結果環境的 Python 解釋器中工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM