Python Error: “ImportError: No module named six”

前端 未结 7 622
清酒与你
清酒与你 2020-12-20 13:18

I am running Python 2.7 on a Windows 7 OS

Here is what I run:

>>> import matplotlib.pyplot as plt

Then I get this:

相关标签:
7条回答
  • 2020-12-20 13:54

    for me i had two versions of matplotlib installed. Just run "pip uninstall matplotlib", and again run "pip install matplotlib". For me multiple doenloads messed up everything. First try this, and if it does not help move to the next steps.

    0 讨论(0)
  • 2020-12-20 13:56

    Copy six.py and six.pyc to \Lib.

    0 讨论(0)
  • 2020-12-20 14:01

    At the command line, navigate to the folder that contains the setup.py and run

    python setup.py install
    

    This will install the six package in your Python site-packages folder where all 3rd-party modules live. You should now be able to import matplotlib without any problems.

    0 讨论(0)
  • 2020-12-20 14:03

    After fighting long found the way it works. Python 3.4 version.

    Actually as many say you can download the six package as .zip file and extract the content in the "site packages" folder (C:\Python34\Lib\site-packages) so that the init.py file that includes "six" module is belong read from there.

    After this from the same file of init.py when we run the python script we run 4-5 module errors stating the module is not available. I found this page extremely useful after long search and just follow on with the errors IDLE states.

    Good luck!"

    0 讨论(0)
  • 2020-12-20 14:07

    You need to install it on your system. This basically means putting the zip file where Python can find it, but by far the easiest way is pip install six. This will download it a second time, though.

    Like the matplotlib installation instructions mention, six is a dependency of the dateutil package. Most sane installation methods would pull in this dependency automatically; if you had done pip install python-dateutil in the first place, this missing dependency should have been satisfied behind the scenes. If you require a completely manual installation, you should give those instructions a thorough read.

    0 讨论(0)
  • 2020-12-20 14:08

    I might be late to this, but I was having the same problem. After I pip installed Pandas though, the problem went away. After the cleanup, I got this message

    "Successfully installed pandas pytz six"

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