Fake installization in django - django

When I install django (pip install django) the cmd say Requirement already satisfied
but when I do this (django-admin --version) to get the version the cmd say
'django-admin' is not recognized as an internal or external command,
operable program or batch file.

Related

I can't create a django project

I typed django-admin startproject myproject in command pallet and it gave me this error message: 'django-admin' is not recognized as an internal or external command, operable program or batch file. I would realy appreciate some explination or tips. Thank you!
I will assume that you are using Linux. You have to follow some basic steps in order to make Django work.
First of all, verify if you have Python3 installed in your operating system:
python3 --version. It should return something like: 3.6.9.
Then, you have to install Django. I recommend using virtualenv for that. First of all, install venv and pip for Python:
sudo apt install python3-venv python3-pip.
Then, create virtual environment (so you don't break your "main" Python instance):
python3 -m venv venv.
Activate virtual environment:
source venv/bin/activate
Then, install Django in Virtual environment:
pip install django
If you followed all of the steps above, Django should create new project.
If you're using Windows, MacOS or ChromeBook - then verify, how to install Django there. In case of Windows I recommend WSL, so you can do everything in "linux way".
These methods may be helpful to you:
django-admin is not recognized as an internal or external command,operable program or batch file.
Troubleshooting “django-admin is not recognized”
django-admin' is not recognized as an internal or external command, operable program or batch file.
https://docs.djangoproject.com/en/3.0/howto/windows/

Virtualenv and django not working in bash on windows 10

I have a problem with using virtualenv and django in bash. If I type python -m venv env in cmd, then env\Scripts\activate, and then virtualenv - I get 'virtualenv' is not recognized as an internal or external command, operable program or batch file.. If I do the same in bash I get bash: virtualenv: command not found. How do I fix this?
Try the following to resolve your issue.
Check all of the environment variables related to the software you require to be used at least.
Check the permissions for files and folders for the software.
Sometimes uninstalling and installing the software with issues can solve problems quickly.
If you have performed number 2. and you are still have errors, proceed to number 3.
You may have dependencies missing, a good tool i have used on Windows is Dependency Walker, and the software will check if any file and dependencies are missing, and you should be able to download them.
An error message may output a file is not found but in fact a dependency is missing, relating to the software you are trying to run.
Try the following steps in the terminal, it may solve your problem.
using terminal, mkdir to make a directory for your project
cd to your project folder/dir
type pip3 freeze, it will show up all the installed packages and dependencies on global scope/system
but we gonna have a venv where we will install our necessary packages and dependencies
type python3 -m venv ./venv to create venv inside your current project folder, please ensure you are inside the folder before running this command
[if you are not using python 3, then the command will be python -m venv ./venv]
to actiavte environment,
on mac, run source ./venv/bin/activate ||
on windows, run .\venv\Scripts\activate.bat [if it doesn't work, try to put your absolute path]
you can check what is installed inside venv using pip freeze, you will see nothing inside the venv
Now you can install django inside venv for your project
to deactivate the environment, just type deactivate

Unable to install pip on windows 10 with Python 2.7 [duplicate]

This question already has answers here:
'pip' is not recognized as an internal or external command
(39 answers)
Closed 1 year ago.
I am on Windows 10 with Python 2.7 installed. I installed pip following instructions here:
I also see following message at end of installation:
Successfully installed pip-20.3.4
But when I do 'pip help'(in a new command prompt), I see:
'pip' is not recognized as an internal or external command, operable
program or batch file.
What else is needed to get it working?
Manually add pip path to env variable PATH. Pip is installed at location C:\Python27\Scripts.

Error message 'mkvirtualenv is not recognized as an internal or external command'

While I was trying to execute the mkvirtualenv command on the command prompt, I was getting this error:
C:\Users\mukesh>mkvirtualenv myproject
'mkvirtualenv' is not recognized as an internal or external command, operable program or batch file.
For Python 3.3 or newer, Commands for installing, creating and activate virtual environment has been changed.
You can install virtual environment using pip:
py -m pip install --user virtualenv
For creating new environment:
py -m venv myproject
To activate your virtual environment:
.\myproject\Scripts\activate
After activating virtual environment, You’ll see “(myproject)” next to the command prompt.
You may find this link useful, as it shows the steps required. It is possible you have simply missed the earlier steps, leading to the error.
The below information is from: https://docs.djangoproject.com/en/2.2/howto/windows/
This will run you through the creation of a virtual environment on Windows:
Install virtualenv and virtualenvwrapper¶
virtualenv and virtualenvwrapper provide a dedicated environment for each Django project you create. While not mandatory, this is considered a best practice and will save you time in the future when you’re ready to deploy your project. Simply type:
pip install virtualenvwrapper-win
Then create a virtual environment for your project:
mkvirtualenv myproject
The virtual environment will be activated automatically, and you’ll see “(myproject)” next to the command prompt to designate that. If you start a new command prompt, you’ll need to activate the environment again using:
workon myproject
To create a virtual environment,
decide upon a directory where you want to place it, and run the venv module as a script with the directory path:
python3 -m venv tutorial-env
This will create the tutorial-env directory if it doesn’t exist, and also create directories inside it containing a copy of the Python interpreter and various supporting files.
A common directory location for a virtual environment is .venv. This name keeps the directory typically hidden in your shell and thus out of the way while giving it a name that explains why the directory exists. It also prevents clashing with .env environment variable definition files that some tooling supports.
Once you’ve created a virtual environment, you may activate it.
On Windows, run:
tutorial-env\Scripts\activate.bat
On Unix or MacOS, run:
source tutorial-env/bin/activate
some times the environment will not active because users are not allowed to run scripts in the current system so you should
-go to windows PowerShell
-run as administrator
-then past this code
-Set-ExecutionPolicy -Scope CurrentUser Unrestricted
now you are allowed to run scripts on your system
then try this again
py -m pip install --user virtualenv
For creating new environment:
py -m venv myproject
To activate your virtual environment:
.\myproject\Scripts\activat
If you have a Windows computer (and installed the Windows version virtualenvwrapper-win), make sure you add the Scripts folder to the path. As per the installation instructions:
To use these scripts from any directory, make sure the Scripts
subdirectory of Python is in your PATH. For example, if python is
installed in C:\Python27, you should make sure C:\Python27\Scripts is
in your PATH.
Here's some decent instructions on how to edit your path. Nowadays you can probably create a new entry after selecting to edit the path environment variable. That new entry should just be the location of the Scripts folder (including the Scripts folder). No need to add semicolons to a super long path name - it generally does that for you nowadays. You'll probably have to restart your computer for it to take effect.
You can find out where your Python is installed here. If you are on Windows and installed Python via the Microsoft Store, you won't see a Scripts folder. In that case, install Python from the Python website, not from the Microsoft Store.

How to run python file from windows?

i have installed following packages to my windows machine -
python-numpy
python-matplotlib
python-pyside
but when i m running a command "python script.py" it says python is not an internal or external command
You need to add Python to your environmental variables.
More info under this link
http://docs.python.org/2/using/windows.html