How to install the Six module in Python2.7

前端 未结 3 610
渐次进展
渐次进展 2021-01-11 13:53

I am using Python 2.7 and trying to use dateutil as follows:

from dateutil import parser as _date_parser

However, I get the fo

相关标签:
3条回答
  • 2021-01-11 14:28

    here's what six is:

    pip search six
    six                       - Python 2 and 3 compatibility utilities
    

    to install:

    pip install six
    

    though if you did install python-dateutil from pip six should have been set as a dependency.

    N.B.: to install pip run easy_install pip from command line.

    0 讨论(0)
  • 2021-01-11 14:35

    I had the same question for macOS.

    But the root cause was not installing Six. My macOS shipped Python version 2.7 was being usurped by a Python2 version I inherited by installing a package via brew.

    I fixed my issue with: $ brew uninstall python@2

    Some context on here: https://bugs.swift.org/browse/SR-1061

    0 讨论(0)
  • 2021-01-11 14:37

    You need to install this

    https://pypi.python.org/pypi/six

    If you still don't know what pip is , then please also google for pip install

    Python has it's own package manager which is supposed to help you finding packages and their dependencies: http://www.pip-installer.org/en/latest/

    0 讨论(0)
提交回复
热议问题