ImportError:DLL加载失败:导入_socket时%1不是有效的Win32应用程序

时间:2016-12-01 04:02:01

标签: python mysql django

我已经看到这个问题,但我认为我的情况很独特。我最近安装了MYSQL,从那时起,每当我运行python manage.py runserver时,我都会收到此错误

Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
  File "C:\Users\ELITEBOOK\.virtualenvs\charles\lib\site-packages\d
le>
    from django.apps import apps
  File "C:\Users\ELITEBOOK\.virtualenvs\charles\lib\site-packages\d
    from .config import AppConfig
  File "C:\Users\ELITEBOOK\.virtualenvs\charles\lib\site-packages\d
    from django.core.exceptions import AppRegistryNotReady, Imprope
  File "C:\Users\ELITEBOOK\.virtualenvs\charles\lib\site-packages\d
    from django.utils.encoding import force_text
  File "C:\Users\ELITEBOOK\.virtualenvs\charles\lib\site-packages\d
    from django.utils.six.moves.urllib.parse import quote, unquote
  File "C:\Users\ELITEBOOK\.virtualenvs\charles\lib\site-packages\d
    result = self._resolve()
  File "C:\Users\ELITEBOOK\.virtualenvs\charles\lib\site-packages\d
    module = _import_module(self.mod)
  File "C:\Users\ELITEBOOK\.virtualenvs\charles\lib\site-packages\d
    __import__(name)
  File "c:\python27\Lib\urllib.py", line 26, in <module>
    import socket
  File "c:\python27\Lib\socket.py", line 47, in <module>
    import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.

MYSQL会干扰我的Python安装吗?我尝试卸载Python,并删除所有文件。然后重新安装32位Python,但无济于事

编辑我解决了这个问题,我看起来好像安装了两个版本的Python并且不知道它。我卸载了两个版本并重新安装了x86-64版本

1 个答案:

答案 0 :(得分:0)

OP自己解决了问题,这个解决方案被编辑成问题:


<块引用>

我解决了这个问题,看起来我有两个版本的 Python 安装了,不知道。我卸载了两个版本和 重新安装了 x86-64 版本