'django-admin' is not recognized as an internal or external command,
operable program or batch file... So I am getting this error in terminal. I am trying to build an app. First I opened a folder(page) in my computer D drive and then opened Visual Studio Code. From there I opened the folder(page) and from view I opened terminal. Then when I am trying to type django-admin myproject page. it is showing this error.
As you are using conda environment, use conda activate to activate the environment, and then you can use the Django module.
This error is occurring due to the missing Django module.
If you're using a virtual environment, do you have it activated?
Is you you python scripts folder in PATH?
On windows: Search for 'Edit the system environment variables'.
Click on 'Environment Variables...'
In System Variables look for row with variable name Path. Click on it and then Edit.
You'll see a number of directories. Do you see one ending with something like ..\Python\Python39\Scripts?
If you have that folder open it and make sure you have django-admin.exe inside.
Related
I went on the cmdl and pip install cookiecutter
This worked fine because when i do
pip show -f cookiecutter
I have the information of where it was saved(i.e: c:\users\name\appdata\roaming\python\python39\site-packages
But when I try to run the following command in the folder I want my template to be created in
cookiecutter -c v1 https://github.com/drivendata/cookiecutter-data-science
This error message is displayed:
'cookiecutter' is not recognized as an internal or external command,
operable program or batch file.
After reviewing countless other similar posts, I think this might have to do with the virtual environment or path that is active but I have no idea what that means and how to make changes in my system.
To use cookiecutter, type "python" in the Windows search bar. Your current python version should show up. In the window that pops-up, click "open file location". Right click the python shortcut icon and click "open file location" again. Look for the "Scripts" folder and double click it. If you installed cookiecutter correctly, you should see it in the "Scripts" folder.
Copy the file path and open up "System Properties". In "System Properties", click on "Environment Variables", then open up "PATH" and add the link you just copied to path. Click "OK" to all and restart the command prompt. Using the command prompt, go to the folder where you want to set up the project in your local system and run the following:
cookiecutter -c v1 https://github.com/drivendata/cookiecutter-data-science
If it works, it should ask you for project name, author name etc.
I having been working a project on Visual Studio Code the whole time and now I am trying to switch to Pycharm and continue on the same project.
I have created for a project a virtual environment in project called env which when I activate it in Pycharm it works except that when I try to run code it shows the following error:
bash: python: command not found
Worth to mention that I am working on a Django project and the I am trying the run the server after activating the env
Also I tried to configure Python but it is showing nothing
What should I do to proceed without having to download all packages from scratch?
Thank you
Is that python installation in the PATH?
edit (sorry for the lack of info): hit 'Windows Key + R', and type 'sysdm.cpl', then click 'enter'. Select the advanced tab at the top, and click 'Environment Variables'. Under System variables, find the variable with the name 'Path' and click Edit. Go to the end of the Variable Value field and type ';C:\Python39'. Now, close out of all of the boxes and open the command prompt and type 'python --version'. It will show your current python version if you successfully added python to the PATH.
correction
i edited the environment variable to path Scripts, but in the command prompt on typing the pip command it does not shows up the package installation
python\scripts location picture
While executing the pip command in the command prompt, it shows pip is not recognized as an internal or external command, operable program or batch file.
I tried setting environment variables and all other alternative solution still I am not able to solve it. I recently noticed pip.exe file missing from python/scripts module.
Is that reason to show up this error? if it is yes, how will I install it manually?
You should add the full directory to the Scripts folder to your PATH environment variable. When you run commands in a command prompt, Windows will search through the folders listed in PATH.
Assuming you are on Windows 10:
Press the start button then search "Environment Variables"
Click the "Edit Environment Variables" option.
Click the "Environment Variables" button in the box that pops up.
Scroll down and find the PATH variable, double click it.
Click "New"
Paste in the path to the Scripts folder.
Save it and exit, then restart the terminal. Now pip will be recognized.
Finally I solved it.I used python 3.8.3 version.Not folder named "Scripts" in this version.I just delete this version and reinstall python 3.7.8 version and then pip is here :D
I know this has been solved, but another way of dealing with this is to create an empty file in the 'Scripts' folder and rename it to pip.bat. Then add the following code:
python -m pip %*
Which simply passes all the arguments of the pip command to python.
I was having some issues with my .virtualenv folders (had 2 projects working in parallel, and one virtual environment was looking at the other), so I manually deleted them and re-did a pipenv/pip install of just 1 project. I verified that the new folders for the same project got created. However, when I try to debug the project using Visual Studio Code, it gives me this error:
& : The term 'C:\Users\userId\.virtualenvs\project-1abcde2S\Scripts\python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the path is correct and try again.
Where the project-1abcde2S points to the folders I deleted. Is there anyway to ensure that new virtual environments get picked up in Visual Studio code? any other tips on debugging a Django project would be helpful!
When you first select an environment for a workspace it gets written to your .vscode/settings.json configuration file. It sounds like you just need to update that setting by selecting your new environment.
I have Installed Python 3.4 onto a new PC. Python works but I am trying to get pip to work on this. I have made a path for Python which is below.
C:\Python34\python.exe
When i run the below code
C:\Windows\System32>pip install python-docx
'python' is not recognized as an internal or external command,
operable program or batch file.
It seems that you haven't configured your PATH variable correctly. In order to do so:
Hold down the Win key and press Pause.
Click Advanced System Settings.
Click Environment Variables.
Append ;C:\Python34 to the PATH variable.
Restart Command Prompt.
(You may also just run set PYTHONPATH=%PYTHONPATH%;C:\Python34 in the cmd)
Further information is available in The Official Python Installation Guide for Windows.