When easy_install is used on some Linux machines to install MySQLdb, the web. py makes several RESTful APIs and several webpages. To interact with MySQL, you need to use the Python library MySQLdb. When you use the "sudo easy_install MySQL-python" command to install MySQLdb, the system prompts"
Please install a more recent version first, using 'easy _ install-U distribute '. ", I will execute the" sudo easy_install-U distribute "command to upgrade distribute. Unexpectedly, easy_install is not available after the upgrade. The following error occurs:
The code is as follows: |
Copy code |
Jay @ jay-linux :~ $ Sudo easy_install MySQL-python Traceback (most recent call last ): File "/usr/local/bin/easy_install", line 9, in <module> Load_entry_point ('stristriket', 'console _ Scripts', 'Easy _ install ')() File "/usr/local/lib/python2.7/dist-packages/setuptools-1.4.1-py2.7.egg/pkg_resources.py", line 357, in load_entry_point Return get_distribution (dist). load_entry_point (group, name) File "/usr/local/lib/python2.7/dist-packages/setuptools-1.4.1-py2.7.egg/pkg_resources.py", line 2393, in load_entry_point Raise ImportError ("Entry point % r not found" % (group, name ),)) ImportError: Entry point ('console _ Scripts', 'Easy _ install') not found |
The version after distribute is upgraded to version 0.7 is incompatible with easy_install, because distribute is merged with setuptools after Version 0.7, find a useful solution on the Internet (applicable to CentOS, Ubuntu, and Mac), as follows:
1. Delete executable files related to the easy_install command
Check your/usr/bin and/usr/local/bin for easy_install installations and remove any old script:
The code is as follows: |
Copy code |
Jay @ jay-linux :~ $ Sudo rm/usr/bin/easy_install * Jay @ jay-linux :~ $ Sudo rm/usr/local/bin/easy_install * |
2. Download and install distribute
Download and run distribute:
The code is as follows: |
Copy code |
Jay @ jay-linux :~ $ Curl-O http://python-distribute.org/distribute_setup.py Jay @ jay-linux :~ $ Sudo python distribute_setup.py Jay @ jay-linux :~ $ Sudo rm distribute_setup.py |
If the above distribute_setup.py cannot be downloaded successfully, then you can directly download The distribute source package: https://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
Refer to the installation process of this document, https://pypi.python.org/pypi/distribute/0.6.49
3. Execute easy_install again and fix it.
Try again, and enjoy. E. g .:
The code is as follows: |
Copy code |
Jay @ jay-linux :~ $ Sudo easy_install pip Jay @ jay-linux :~ $ Sudo easy_install MySQL-python |