MySQL安装失败并出现编译器错误

时间:2019-01-14 19:05:28

标签: python mysql sqlalchemy

我与MySQL数据库建立连接时遇到问题。

我有以下代码:

Public Sub BuildAssetFoldersStructure()
    Debug.WriteLine(vbCr & "Creating Assets folders from DevForm.AssetsFolderStructure")
    Dim n As TreeNode
    For Each n In DevForm.AssetsFolderStructure.Nodes
        PrintRecursive(n)
    Next

End Sub


Private Sub PrintRecursive(ByVal n As TreeNode)

    Dim dpath As String = Nothing
    Dim finalNodeText As String = Nothing

    If n.Text.Substring(0, 1) = "[" Then

        For Each col In New List(Of String) From {"red", "white", "blue"}

            dpath = Path.Combine(My.Settings.fileAssetsPath, n.Parent.FullPath & "\" & col)
            System.Diagnostics.Debug.WriteLine("Creating: " & dpath)
            Directory.CreateDirectory(dpath)
        Next

    Else
        dpath = Path.Combine(My.Settings.fileAssetsPath, n.FullPath)
        System.Diagnostics.Debug.WriteLine("Creating: " & dpath)
        Directory.CreateDirectory(dpath)
    End If

    Dim aNode As TreeNode
    For Each aNode In n.Nodes
        PrintRecursive(aNode)
    Next

End Sub

此代码生成以下错误:

Creating Assets folders from DevForm.AssetsFolderStructure
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\red
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\white
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\blue
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\[SystemName]\Game-Images
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\[SystemName]\Game-Videos
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\[SystemName]\Game-Music
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\[SystemName]\System-Images
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\[SystemName]\System-Images\red
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\[SystemName]\System-Images\white
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\[SystemName]\System-Images\blue
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Systems\[SystemName]\System-Videos
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\Database\Emulators
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\User
Creating: C:\Users\Steve\Documents\Visual Studio 2017\Projects\GameInfoz\GameInfoz\bin\Debug\Assets\User\Avatars

当我尝试:pip安装mysql时,出现以下错误:

connection_string = "mysql+mysqldb://{user}:{password}@{host}/{database}?charset=utf8mb4".format(
    user=config[db]["user"], password=config[db]["password"],
    host=config[db]["host"], database=config[db]["database"])

sqlalchemy_engine = sqla.create_engine(connection_string, convert_unicode=True)

说实话,我不知道这里发生了什么(pip install mysql-python生成完全相同的错误,以及pip install oursql和pip install mysqlclient)。我发现cc是C编译器。我已经安装了(gcc)。有人可以帮忙吗?

0 个答案:

没有答案