%1不是有效的Win32应用程序

%1不是有效的Win32应用程序

本文介绍了ImportError:DLL加载失败:导入_socket时,%1不是有效的Win32应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've seen this question asked already but I think my situation is unique. I recently installed MYSQL and since then whenever I run python manage.py runserver I get this error:

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,但无济于事.

Could MYSQL be interfering with my Python installation? I tried uninstalling Python, and deleting all the files. Then reinstalling 32-bit Python but to no avail.

推荐答案

这篇关于ImportError:DLL加载失败:导入_socket时,%1不是有效的Win32应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 16:00
查看更多