You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Python 3.6.2安装后Django启动报错:找不到simplesocial模块

ModuleNotFoundError: No module named 'simplesocial' – What It Means & How to Fix It

Is This Error Impactful?

Absolutely. This error blocks Django from loading your project’s core settings, so you won’t be able to use any Django-specific functionality in the shell—like interacting with models, running management commands, or accessing project configurations. Until resolved, your Python shell won’t recognize your Django project at all.

Common Causes & Fixes

Let’s walk through the most likely scenarios and straightforward fixes:

  • You’re not using manage.py or are in the wrong directory
    When you create a Django project named simplesocial, it generates a folder structure where simplesocial is your project root (containing settings.py). If you launch the regular Python shell without navigating to the folder where your manage.py file lives, Django can’t locate the settings module.
    Fix: Open your command prompt/terminal, navigate to the parent folder of your simplesocial project directory, and run:

    python manage.py shell
    

    This command automatically configures Django’s environment to find your project settings, so you won’t hit the error.

  • You’re using the plain Python shell but haven’t set the settings module
    If you prefer using the regular Python shell (instead of manage.py), you need to manually tell Django where to find its settings.
    Fix:

    1. First, set the environment variable for your settings module:
      • On Windows (Command Prompt):
        set DJANGO_SETTINGS_MODULE=simplesocial.settings
        
      • On Linux/macOS:
        export DJANGO_SETTINGS_MODULE=simplesocial.settings
        
    2. Then, in the Python shell:
      import django
      django.setup()
      

    This will initialize Django with your project’s settings correctly.

  • Typos or mismatched project name
    Double-check that your project folder is actually named simplesocial (note that this is case-sensitive!). If you accidentally named it something else (like simple_social with an underscore), Django won’t find the module.
    Fix: Verify your project folder name and update the settings module path to match (e.g., use simple_social.settings if that’s your actual project name).

Quick Recap

The core issue is that Django can’t locate your project’s settings module. Using python manage.py shell is the simplest way to avoid this, as it handles all environment setup automatically. If you need the plain shell, just make sure to set the DJANGO_SETTINGS_MODULE variable before initializing Django.

内容的提问来源于stack exchange,提问作者Shri

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:42:25