I am using Windows 8 64-bit. I installed Python, and see that Windows Path is appended by the two paths : C:\Python27\Scripts; C:\Python27;
So when I run cmd and type python I get the error
'python' is not recognized as an internal or external command,
operable program or batch file.
I also tried py, same error.
I'm currently using the solution proposed here, so I'm typing
C:\Python27\python.exe manage.py runserver for example. But this is not what I want. How can I make it work with the command python?
Thanks in advance.
You should not have a space after the semicolon in the PATH value.
Related
I have installed Visual Studio Code (VSC) and Code Runner.
When I use the terminal to execute my code it works fine and I get the results in the terminal window:
However, when I try to use Code Runner's keyboard shortcut Ctrl+Alt+NI keep getting this error message:
Which baffles me because VSC shows this:
I've tried rebooting (solution on another related SO question), creating a new conda environment inside VSC along with what seemed to be relevant from the VSC documentation here and here.
If anyone can help me understand what I need to be doing differently I would appreciate it.
You need to set a symbolic link between calling Python3 and Python since they're effectively the same thing. If you go into a normal command prompt / terminal and type Python3, you may get the same error. Whereas, if you type Python, it will launch the Python interpreter.
Close VSCode
If you're a Windows user you can use mklink to sort it out — open a Command Prompt as an Administrator, then navigate to your Python installation. e.g.:
cd C:\Python38
mklink python3.exe python.exe
In Linux, you can set a Symbolic link:
cd /usr/bin/python3
ln -s python.exe python3.exe
Startup VSCode again and it should work.
I am attempting to download modules in Python through pip. No matter how many times I edit the PATH to show the pip.exe, it shows the same error:
'pip' is not recognized as an internal or external command,
operable program or batch file.
I have changed the PATH many different times and ways to make pip usable, but these changes go unnoticed by the command prompt terminal.
How should I fix this?
Are you using PyCharm? if yes change the environment to your desired directory and desired interpreter if you do have multiple interpreter available
I am using command prompt to run CUDA on windows. When i open cmd, the current directory is pointed towards home folder. When i type nvcc, output is nvcc : fatal error : No input files specified. It means i can run nvcc with a file. But, when i type python, it shows
'python' is not recognized as an internal or external command,
operable program or batch file.
I need to change my directory to run python.
My question is, how to make python run without changing the directory? Is it like inputting cmd about change in the library path as in ubuntu?
Windows, like Ubuntu, has the concept of a "path", which is a list of directories that the shell will search to try to find the command you typed. Therefore, the nvcc command is probably located in a directory found in your system's path, but the python command is not.
Therefore, you'll need to find where on your system the python command is, and put that command's directory into the path. So, if python is located at C:\Python26\python.exe, you will need to add C:\Python26 into the path.
Superuser has some answers that can describe how to modify the path in windows, or otherwise you can google how to do this. The exact steps may be different depending on the version of Windows that you have.
Additionally, you can also ignore the path and run the python command using the full filename. Instead of typing python, you would type (using the above example) C:\Python26\python. This would have the same effect, although would be a bit more typing.
I'm new to Python. I'm trying to run this script (gencards.py) in Windows, but he says I need to run "the qrencode command". I assume that means this library, or the more likely the windows port.
In the python script, he uses qrencode as so:
os.system("qrencode -o .tempqr.png -s 30 -m 0 -l H " + serial)
I've installed the windows library via the executable, I added qrcode.exe to PATH, and tried editing gencards.py to use "qrcode" or "qrcode.exe" but I always get
'qrcode' is not recognized as an intrnal or external command, operable program or batch file.
What am I doing wrong?
I'm using Python 2.7 on Windows7 x64.
the error message means that Windows does not know what to do with qrcode. Check if it's installed in your system, and if it's directory is included in your PATH environment variable
Try to break the problem down, by first checking if you can run the programm (btw, is it 'grencode' or 'grcode'?) using a command prompt. If you can't then check your PATH settings again. When you succeeded with the command prompt get back to your python script.
I'm installing Python for use with SQLMap. I've downloaded and ran the Python 2.7.2 MSI installer, and restarted my computer. According to everything I've read, I should be able to just call python and SQLMap from the DOS command line using python sqlmap.py, but the command line doesnt seem to recognize the python - I get a 'python' is not recognized as an internal or external command,
operable program or batch file. error.
Do I need to add Python to my path variable? If so, how? Everything I've read says it should work out of the box...
Yes you should add it to your path. Does running C:\Python27\python.exe sqlmap.py work?
See for instance https://superuser.com/questions/143119/how-to-add-python-to-the-windows-path