ImportError: Couldn't import Django

前端 未结 22 1987
无人共我
无人共我 2020-12-05 01:59

I\'ve already configured virtualenv in pycharm, when using the python manage.py command, this is error shown:

E:\\video course\\Python\\code\\web_worker\\MxO         


        
22条回答
  •  广开言路
    2020-12-05 02:48

    I think the best way to use django is with virtualenv it's safe and you can install many apps in virtualenv which does not affect any outer space of the system vitualenv uses the default version of python which is same as in your system to install virtualenv

    sudo pip install virtualenv
    

    or for python3

    sudo pip3 install virtualenv
    

    and then in your dir

    mkdir ~/newproject

    cd ~/newproject

    Now, create a virtual environment within the project directory by typing

    virtualenv newenv
    

    To install packages into the isolated environment, you must activate it by typing:

    source newenv/bin/activate
    

    now install here with

    pip install django
    

    You can verify the installation by typing:

    django-admin --version
    

    To leave your virtual environment, you need to issue the deactivate command from anywhere on the system:

    deactivate
    

提交回复
热议问题