Python 如何使用 Anaconda 安装 Django Rest Framework?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38281563/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 20:36:36  来源:igfitidea点击:

How to install Django Rest Framework using Anaconda?

pythonpython-3.xdjango-rest-frameworkanacondaconda

提问by n_y

Main OS I am using are Ubuntu and Windows.

我使用的主要操作系统是 Ubuntu 和 Windows。

I couldn't find the package in conda.I am using python 3.5.

我在 conda 中找不到包。我使用的是 python 3.5。

回答by Charlotte Mays

DRF is now on conda-forge. You can install it by using:

DRF 现在在 conda-forge 上。您可以使用以下方法安装它:

conda config --add channels conda-forge
conda install djangorestframework

More information about conda-forge: https://conda-forge.github.io/

有关 conda-forge 的更多信息:https://conda-forge.github.io/

回答by vladimir vojtisek

I have installed it on win7 and ubuntu 16.10. To install this package with conda run:

我已经在 win7 和 ubuntu 16.10 上安装了它。要使用 conda 安装此软件包,请运行:

conda install -c anaconda django=1.10.5

activate myenv             # windows cmd
source activate myenv      # linux, MacOS

# Anaconda prompt

 pip install djangorestframework
 pip install markdown       # Markdown support for the browsable API.
 pip install django-filter  # Filtering support

# verify 

 conda list                 # Now you should see it on your list

回答by Nditah

django takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. To install this package with conda run https://anaconda.org/anaconda/django:

django 处理了 Web 开发的大部分麻烦,因此您可以专注于编写应用程序而无需重新发明轮子。要使用 conda 安装此软件包,请运行https://anaconda.org/anaconda/django

conda install -c anaconda django

I just installed django 1.11.3 on Python 3.6.2 Anaconda, Windows 10

我刚刚在 Python 3.6.2 Anaconda、Windows 10 上安装了 django 1.11.3

回答by Kevin Panko

This answer was posted inside the question:

这个答案发布在问题中:

The easiest is to go in to conda environment and use pip inside to install Django by doing:

最简单的方法是进入 conda 环境并在里面使用 pip 安装 Django:

> activate $your_conda_env
> pip install djangorestframework

回答by Praneeth Gopinathan

just typing

只是打字

pip install django
pip install djangoframework

or use a virtual environment to install those packages for that, first you need to install a virtual environment

或者使用虚拟环境来安装这些包,首先你需要安装一个虚拟环境

pip install virtualenv

then create a new directory and make new virtual environment eg:

然后创建一个新目录并创建新的虚拟环境,例如:

mkdir django
cd django
virtualenv django_project1
source django_project1/bin/activate
pip install django
pip install djangoframework

this will install django framework inside the virtual environment

这将在虚拟环境中安装 django 框架

will install django framework in your computer. And also update your pip packages using

将在您的计算机中安装 django 框架。并且还使用更新您的 pip 包

pip update $PKG_NAME

eg:

例如:

pip update python