简体   繁体   中英

PyhtonError ImportError: No module named six

I am running Python 2.7.13 on Windows 7, and I got this error:

ImportError: No module named six

But I found six.py and six.pyc in "C:\\Python27\\Lib\\site-package\\pip\\_vendor\\six.py", ""C:\\Python27\\Lib\\site-package\\pip\\_vendor\\six.pyc".

  1. Can I copy this file six.py into my project? Or I must download and install the module named six?
  2. What function does six.py or module named six have?

You can run to make sure if six is properly installed or not,

pip install six 

if output says module is already installed and still the problem persists then you can visit and download the wheel file of six module from the link : https://pypi.python.org/pypi/six

To install wheel file again method is same:

pip install wheel_file_name.whl

Yes, you can install six into a python project and for that you don't have to copy the .py or .pyc file of six, for that you have to create a virtual enviroment in the project, follow this link on how to create and manage a virtual environment for python project in windows : http://pymote.readthedocs.io/en/latest/install/windows_virtualenv.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM