Django Tutorial - install the previously cloned copy of Django - django

I was following this tutorial when this error occurred. I would appreciate it if anyone could tell me what is going wrong here.
https://docs.djangoproject.com/en/3.0/intro/contributing/
(djangodev) (base) XXXX#XXXX-MacBook-Air hello_django % python -m pip
install -e /path/to/your/local/clone/django/
ERROR: /path/to/your/local/clone/django/ is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with svn+, git+, hg+, or bzr+).
This occurred after entering the following code
% git clone https://github.com/XXX/django.git
$ python3 -m venv ~/.virtualenvs/djangodev
$ source source ~/.virtualenvs/djangodev/bin/activate
~/.virtualenvs/djangodev/bin/activate
python -m pip install -e /path/to/your/local/clone/django/

The last command should be as executed as follows (After you are in the directory from where you did the clone command)
python -m pip install -e django

Related

django-admin startproject command returning bad interpreter: No such file or directory

I can create a project outside of a virtual environment just fine, but when I am using a venv and try to create a django project, I get the following:
/Users/justin/Desktop/Programming/Python/Django
Projects/env/bin/django-admin: "/Users/justin/
Desktop/Programming/Python/Django: bad interpreter: No such
file or directory
I created the venv with python3 -m venv env, I then tried to run pip install django where the above error also appeared, I then learned I should be using python3 -m pip install django (pip3: bad interpreter: No such file or directory) and this successfully installed django, but I still cannot start a project. I've ran pip install django and django-admin startproject from a venv many times without an issue so it seems like I broke something recently. Does anyone know how to fix this/where I can begin looking for the issue? Thanks for any help.
Save a copy of your project in another folder and Try again.
OR
Step First :- RUN - python -m venv env
Step Second :- pip install django
Step Third :- after that install pip
Step Fourth :- ( If your pip version is lower, then it may be issue after
some time and every time it will show the Warning: for upgrading the pip.
So if version is lower then USE ) python -m pip install -U pip

Django installation on Mac

I'm trying to install Django on Mac, Python version 3.7 already installed , here is the comment I have put in terminal-
Django-admin startproject hello
command not found
pip install virtualenv ,
virtualenv some name inside the less than and greater than sign ,
and then cd into the directory and run:
,
source bin/activate,
pip install Django
hope this will help you.. :)
Follow the following steps to install and use django
Install django. $ python -m pip install --upgrade django
Now, check the installation $ python -m pip freeze | grep django
Create django project $ django-admin startproject mysite
What i see wrong in your question ? You are using Django-admin

Docker Image command pythonreturning non-zero code

So I'm trying to build a new docker image with Python2.7 and pip for python 2.7 however I'm getting a "The command '/bin/sh -c pip2 install -r requirements.txt' returned a non-zero code: 1" error when trying to build the image.
FROM colstrom/python:legacy
MAINTAINER **REDACTED**
RUN pip2 install -r requirements.txt
CMD ["python2.7", "parser.py"]
Any ideas?
You have to COPY/ADD or mount your data (at least requirements.txt and parser.py) into the container.
Assuming your Dockerfile resides at the root directory of your project:
FROM colstrom/python:legacy
MAINTAINER **REDACTED**
COPY . .
RUN pip2 install -r requirements.txt
CMD ["python2.7", "parser.py"]

shell script for django VE causing deactivation of VE

So I am trying this simple script which is essentially this (a full gist can be found here):
#!/bin/bash
virtualenv env
source ./env/bin/activate
pip install --upgrade pip
pip install django
pip freeze > requirements.txt
django-admin startproject mysite .
git init
git config user.name "somename"
git config user.email "some-email#somedomain.com"
gitIgnore="
env/
*.pyc
"
echo '$gitIgnore' > .gitignore
git add .
git commit -a -m 'Initial commit'
After running the script I see that I am no longer within the virtual environment. Not sure why that is. I didn't deactivate at any point, so I would expect that I would still be in the env virtualenvironment.
Anyone can please shed some light on why my virtual environment is getting deactivated?

Cannot install anything using Pip

I am trying to install this one: https://pypi.python.org/pypi/textblob-aptagger and it says to use this code - but I do not know where to use it (command line and Python console do not work):
$ pip install -U textblob-aptagger
I installed easy_install and pip using exe files from
http://www.lfd.uci.edu/~gohlke/pythonlibs/
So when I use the command:
$ pip install -U textblob-aptagger
in the Python console I get this error:
File "<console>", line 1
$ pip install -U textblob-aptagger
^
SyntaxError: invalid syntax
Where should I use this installation command?
You run the executable from the command line, but since it's not in your PATH, you'll need to supply the full filepath. On my system pip is installed at C:\Python27\Scripts, so the command I would use to install textblob-aptagger would be C:\Python27\Scripts\pip.exe install -U textblob-aptagger. Yours will likely be located in a similar if not identical location.