Python - настройка Turbo Gears

504
nineofclubs

Я пытаюсь настроить среду Turbogears для Python, следуя руководству здесь 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 совершает ошибку?

0
Не могли бы вы попытаться переустановить python, но когда вас спросят, установить ли его для всей системы или для всех, выберите всех? Journeyman Geek 8 лет назад 0

1 ответ на вопрос

0
Hannu

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

This tutorial takes for granted that you have a working Python environment with Python2.6 or Python2.7, with pip installed and you have a working browser to look at the web application you are developing.

You have Python 3.5 - this may be the culprit. There are several differences that may cause python-scripts/programs aimed for the older version to malfunction.


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

Guido van Rossum (the original creator of the Python language) decided to clean up Python 2.x properly, with less regard for backwards compatibility than is the case for new releases in the 2.x range. The most drastic improvement is the better Unicode support (with all text strings being Unicode by default) as well as saner bytes/Unicode separation.

Besides, several aspects of the core language (such as print and exec being statements, integers using floor division) have been adjusted to be easier for newcomers to learn and to be more consistent with the rest of the language, and old cruft has been removed (for example, all classes are now new-style, "range()" returns a memory efficient iterable, not a list as in 2.x).