Python - Turbo Gears 設定

Python - Turbo Gears 設定

我正在嘗試按照此處的指南為 Python 設定 Turbogears 環境http://turbogears.readthedocs.org/en/latest/turbogears/wiki20.html#wiki20

我陷入了 virtualenv tgnev 步驟,嘗試了異常訊息中建議的解決方案和其他一些事情,我需要一些指示。

C:\WINDOWS\system32>virtualenv tgenv
Using base prefix 'c:\\program files (x86)\\python 3.5'
New python executable in tgenv\Scripts\python.exe
ERROR: The executable tgenv\Scripts\python.exe is not functioning
ERROR: It thinks sys.prefix is 'c:\\windows\\syswow64\\tgenv' (should be 'c:\\windows\\system32\\tgenv')
ERROR: virtualenv is not compatible with this system or executable
Note: some Windows users have reported this error when they installed Python for "Only this user" or have multiple versions of Python installed. Copying the appropriate PythonXX.dll to the virtualenv Scripts/ directory may fix this problem.

我對 Python 和 virtualenv 完全陌生,所以請不要假設我什麼都知道!

有趣的是,system32\tgenv 不存在,但 syswow64 存在,所以看起來 virtualenv 犯了一個錯誤?

答案1

http://turbogears.readthedocs.org/en/latest/turbogears/wiki20.html#wiki20

本教學假定您擁有一個可運行的 Python 環境Python2.6或Python2.7,安裝了 pip 並且您有一個可以運行的瀏覽器來查看您正在開發的 Web 應用程式。

你有Python 3.5 - 這可能是罪魁禍首。有幾個差異可能會導致針對舊版本的 python 腳本/程式故障。


https://wiki.python.org/moin/Python2orPython3:

Guido van Rossum(Python 語言的原始創建者)決定正確清理 Python 2.x,與 2.x 系列中的新版本相比,較少考慮向後相容性。最顯著的改進是更好的 Unicode 支援(預設所有文字字串都是 Unicode)以及更清晰的位元組/Unicode 分離。

此外,核心語言的幾個方面(例如 print 和 exec 是語句、使用整除法的整數)已進行了調整,以便新手更容易學習並與語言的其餘部分更加一致,並且舊的缺陷已被刪除(例如,所有類別現在都是新樣式的,「range()」返回記憶體高效的可迭代對象,而不是像2.x 中的列表)。

相關內容