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 中的列表)。

相关内容