0

Командная строка:

cmd

c:\phttp\ard\Scripts>pip.exe install Flask

Traceback (most recent call last): File "c:\phttp\ard\lib\site.py", line 703, in main() File "c:\phttp\ard\lib\site.py", line 670, in main virtual_install_main_packages() File "c:\phttp\ard\lib\site.py", line 611, in virtual_install_main_packages if os.path.exists(tk_dir): File "c:\phttp\ard\lib\genericpath.py", line 26, in exists os.stat(path) TypeError: stat() argument 1 must be encoded string without null bytes, not str

Код:

main()

def _script():
help = """\
%s [--user-base] [--user-site]

Without arguments print some useful information
With arguments print the value of USER_BASE and/or USER_SITE separated
by '%s'.

Exit codes with --user-base or --user-site:
  0 - user site directory is enabled
  1 - user site directory is disabled by user
  2 - uses site directory is disabled by super user
      or for security reasons
 >2 - unknown error
"""
args = sys.argv[1:]
if not args:
    print("sys.path = [")
    for dir in sys.path:
        print("    %r," % (dir,))
    print("]")
    def exists(path):
        if os.path.isdir(path):
            return "exists"
        else:
            return "doesn't exist"
    print("USER_BASE: %r (%s)" % (USER_BASE, exists(USER_BASE)))
    print("USER_SITE: %r (%s)" % (USER_SITE, exists(USER_BASE)))
    print("ENABLE_USER_SITE: %r" %  ENABLE_USER_SITE)
    sys.exit(0)

buffer = []
if '--user-base' in args:
    buffer.append(USER_BASE)
if '--user-site' in args:
    buffer.append(USER_SITE)

if buffer:
    print(os.pathsep.join(buffer))
    if ENABLE_USER_SITE:
        sys.exit(0)
    elif ENABLE_USER_SITE is False:
        sys.exit(1)
    elif ENABLE_USER_SITE is None:
        sys.exit(2)
    else:
        sys.exit(3)
else:
    import textwrap
    print(textwrap.dedent(help % (sys.argv[0], os.pathsep)))
    sys.exit(10)

if __name__ == '__main__':
_script()
4
  • чтобы люди с похожей проблемой могли бы найти этот вопрос, сообщение об ошибке следует в виде текста добавлять, а не картинки (если не знаете как текст в Windows консоли скопировать, задайте отдельный вопрос).
    – jfs
    16 апр 2017 в 18:14
  • вероятно проблема к flask не имеет отношения. Если вы любой другой пакет, который у вас не стоит попробуете поставить, то что происходит?
    – jfs
    16 апр 2017 в 18:15
  • перед попыткой установки Flask установил virtualenv подобным образом, установка прошла нормально, а вот Flask начал выдавать ошибки 17 апр 2017 в 13:53
  • Обнаружил, что из папки с python pip работает нормально, а из папки созданной под проект как раз и выдаёт эти ошибки. 17 апр 2017 в 14:00

1 ответ 1

0

Проблема была конечно не у Flack. Из под powershell всё заработало.

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.