解决 MySQL
在 windows 环境安装 MySQL-python-1.2.3b1 遇到错误 ------------ C:/TDDOWNLOAD/MySQL-python-1.2.3b1.tar/MySQL-python-1.2.3b1/MySQL-python-1.2.3b1 setup.py Traceback (most recent call last): File "C:/TDDOWNLOAD/MySQL-python-1.2.3b1.tar/MySQL-
在 windows 环境安装 MySQL-python-1.2.3b1 遇到错误
------------
C:/TDDOWNLOAD/MySQL-python-1.2.3b1.tar/MySQL-python-1.2.3b1/MySQL-python-1.2.3b1
>setup.py
Traceback (most recent call last):
File "C:/TDDOWNLOAD/MySQL-python-1.2.3b1.tar/MySQL-python-1.2.3b1/MySQL-python
-1.2.3b1/setup.py", line 15, in
metadata, options = get_config()
File "C:/TDDOWNLOAD/MySQL-python-1.2.3b1.tar/MySQL-python-1.2.3b1/MySQL-python
-1.2.3b1/setup_windows.py", line 7, in get_config
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_ke
y'])
WindowsError: [Error 2]
------------
WindowsError: [Error 2]
系统找不到指定的文件。
------------
google一时没找到说明,找到的两个相关内容也是俄语的,那就看看代码好了:
file "setup_windows.py", line 7, in get_config
metadata, options = get_metadata_and_options()
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location')
file "setup_common.py" line 5,8, in get_metadata_and_options
config.read(['metadata.cfg', 'site.cfg'])
options = dict(config.items('options'))
file "site.cfg" line 18 in [options]
registry_key = SOFTWARE/MySQL AB/MySQL Server 5.0
很明显,是要找到下面注册表项
HKEY_LOCAL_MACHINE/SOFTWARE/MySQL AB/MySQL Server 5.0
的 Location 键值,而这个键值取出来后就用在后面代码,用来设置 mysql
的 include 目录与 library 目录
file "setup_windows.py", line 19,21, in get_config
library_dirs = [ os.path.join(mysql_root, r'lib/opt') ]
include_dirs = [ os.path.join(mysql_root, r'include') ]
而我机器上的两个mysql一个是 XAMPP 带的,另一个是 mysql-noinstall-5.0.67-win32 都没有写
注册表相应键值。搞清楚了情况,要解决问题就很简单了
然后
setup.py build
setup.py install
测试OK
----------------
MySQL for Python
http://sourceforge.net/projects/mysql-python
MySQL for Python 1.2.3b1 release.
http://sourceforge.net/project/showfiles.php?group_id=22307&package_id=34790&release_id=658932

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

I encountered a tricky problem when developing a small application: the need to quickly integrate a lightweight database operation library. After trying multiple libraries, I found that they either have too much functionality or are not very compatible. Eventually, I found minii/db, a simplified version based on Yii2 that solved my problem perfectly.

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

Article summary: This article provides detailed step-by-step instructions to guide readers on how to easily install the Laravel framework. Laravel is a powerful PHP framework that speeds up the development process of web applications. This tutorial covers the installation process from system requirements to configuring databases and setting up routing. By following these steps, readers can quickly and efficiently lay a solid foundation for their Laravel project.
