Main OS I am using are Ubuntu and Windows.
I couldn't find the package in conda.I am using python 3.5.
DRF is now on conda-forge. You can install it by using:
conda config --add channels conda-forge
conda install djangorestframework
More information about conda-forge:
https://conda-forge.github.io/
I have installed it on win7 and ubuntu 16.10.
To install this package with conda run:
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
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 :
conda install -c anaconda django
I just installed django 1.11.3 on Python 3.6.2 Anaconda, Windows 10
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:
> activate $your_conda_env
> pip install djangorestframework
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
will install django framework in your computer. And also update your pip packages using
pip update $PKG_NAME
eg:
pip update python
Related
I am working on ubuntu, I have python 3.8 as standard installation.
However as my project have dependency on python 3.7 I have installed 3.7 and removed 3.8
now when I am trying to install pip it is installing python3.8 again and getting installed with 3.8.
I am using apt-get -y install pip to install pip.
I want to install pip on top of my python3.7 installation so that pip uses python3.7
my project have dependency on python 3.7
This is where virtual environments really useful. The idea is that you create an environment in which the required version of python and packages can live without altering the installation of python you might want to keep installed for other projects.
There are a few options, but Anaconda / miniconda are a popular way of using virtual environments and fairly easy to use. First you'll need to install miniconda:
https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html
After that from a terminal you need to create your new environment
conda create -n "py3p7" python=3.7
Then activate it:
conda activate py3p7
Then check that you've got pip installed and it's installed under the right python version:
pip --version
Which for me returns:
pip 22.2.2 from /home/MY_NAME/miniconda3/envs/py3p7/lib/python3.7/site-packages/pip (python 3.7)
I am using conda as the Python3 package management tool, sometimes the conda repo did not contains some Python package. So I have to install it using pip, first I found the anaconda environment folder, the next step switch to the anaconda environment folder:
cd /usr/local/anaconda3/envs/pydolphin
then using this command to install package:
./bin/pip install musicbrainzngs
is there any short way to do this? is it possible to install it the PyCharm IDE the simple way? the PyCharm IDE using conda install by default.
First activate your conda environment:
conda activate <env>
This will switch to the version of pip installed in this environment. Then you can install using pip as per normal which will install it into your conda environment:
pip install musicbrainzngs
This question already has answers here:
pip is not recognized in Anaconda Prompt
(7 answers)
Closed 2 years ago.
I have installed python using Anaconda platform, The problem is that when I want to install Django through command prompt, it shows an error 'pip is not recognized as an internal or external command.'
Please suggest a solution. Thanks in advance. :)
AFAIK, In anaconda platform you can't use pip, you have to use conda.
And to install django in anaconda platform, try running the following command, conda install django.
Or try this url https://www.coresumo.com/install-django-on-anaconda/
you can also try conda install pip and then continue as normal python environment after creating the virtual environment.
try conda create --name myenv
and then activate the environment using myenv\source\activate and then install pip using
conda install pip after that you can install django.
follow this link after the process for better understanding and there also guide lines to install Django in the newly created virtual environment.
Just do these steps:-
1) create a virtual environment and activate the same virtual environment.
2) then install Django with pip.
If you are using Ubuntu then run below command on terminal.
$ mkvirtualenv <virtual_env_name> or virtualenv <virtual_env_name>
$ workon <virtual_env_name> or source <virtual_env_name>/bin/activate
$ conda install pip
$ conda install django or pip install django
for window user refer http://www.learnexia.com/?p=857 and https://anaconda.org/anaconda/django
How do you install Python 3.6.x in a virtualenv using pip in Windows 10?
pip install python, pip install python3, pip install python3.6 don't work.
Pip and virtualenv are two separate tools. Pip is a package manager, you will use it to install packages into your virtual environment once it has been set up. Pip does not actually manage the virtual environment. Virtualenv is the tool that handles creating virtual environments.
First, you should check if you have virtualenv installed with virtualenv --version. If you do not have it, you will get an error that virtualenv is not found. You can use pip to install virtualenv with pip install virtualenv.
Once you have virtualenv, you can create a python 3.6 environment with virtualenv -p python3.6 /path/to/myvirtualenv. You will need an installation of python 3.6 for this command to work, so download and install python 3.6 first if you do not have it.
I believe that on windows if you don't have python 3.6 in your PATH variable, you may need to point directly to the python 3.6 installation instead with virtualenv -p /path/to/mypython3.6 /path/to/myvirtualenv.
See Virtualenv User Guide
I needed a virtual environment with all the global packages included. I created one, and the global Django version is 1.3.1. Now, I need to upgrade the Django version to 1.4 only in my virtual environment. I switched to my environment by activating it, and tried
sudo pip install Django=1.4
It was installed,not in the virtual env but in the global dist-packages.
How to install a package only in the virtual environment?
After you switch to the virtual environment with the activate script. Just use pip install Django==1.4 no sudo needed.
Alternately you can use pip install -E=/path/to/my/virtual/env Django==1.4 in which case you don't need to switch to the virtual environment first.
If you just want to upgrade a package and don't know the version number you want to upgrade to you can use
pip install <package_name> --upgrade
in your virtualenv. So in your case above the following would work as well:
pip install django --upgrade
Instead of --upgrade just -U is also enough.
get your answer from
http://djangopaper.com/post/9334151791/install-multiple-django-version-using-virtualenvwrapper