How to install TinyDB? - python

I am trying to install TinyDB as I need to use it for a python program. I have tried following tutorials that suggest installing it via the command prompt. However, whenever I type 'python', it says ''python' is not recognized as an internal or external command,
operable program or batch file.' I have tried adding 'C:\python37-32\' to the end of the PATH variable but it has made no difference. Does anyone have any suggestions?

Check that python.exe is actually in C:\python37-32\
Check if PATH is set correctly in your cmd, type echo %PATH%, if not, try rebooting your system
Once the directory where python.exe is correctly added to PATH, you should be able to run
python -m pip install tinydb

Related

Not recognized as an internal or external command, operable program or batch file

Our professor has given us the assignment of downloading and setting up...
https://github.com/spyoungtech/hikvision-recover
...for a cyber security class
As stated I used pip to install from the command line. I then test to see if it was successful with
pip show hikvision-recover and it is successful.
Yet, when I try to run the command on a windows shell I get a "Not recognized as an internal or external command." I'm assuming this has to do with the command not being found? But I'm not really sure where to start.
According to documentation I should just be able to
hikvision-recover <serial number> <Date information>
and it will return the recovery password.
Update: When I try python -m I get
The executable, if it was created, is not in your path. You can try:
python -m hikvision-recover <serial number> <Date information>
It looks like the pip you used to install hikvision-recover is not the same version of python you are using. When installing a module, it is always a good practice to do the following on your command prompt:
where python
It will show you which python executable the prompt will use where invoke python.
Double check pip is the same version as python:
where pip
If the version are not the same, you need to modify your environment variable. Go Window menu - Edit the system environment variable - Environment variables - Path (User variable) and modify the order should you have more than one python version on the list.

Installing python with path variables via batch script

I'm trying to install python and 1 pypi module programmatically via a batch script, to allow me to run a script I wrote that needs that module, on several PCs. A batch script will make it easier to install. I have tried
\\server\share\python-3.6.1.exe /quiet InstallAllUsers=1 Include_pip=1 Include_test=0 PrependPath=1
python -m pip install utm
pause
Without success. When run, this throws the error ‘python’ is not recognized as an internal or external command. I realize this means the system path variables have not been updated correctly, but I thought PrependPath=1 was setting these variables correctly. Any help anyone could provide would be appreciated.
PrependPath will add to the path, you have to re-read the path again in order for the command to work.
You can re-read the path by using RefreshEnv.cmd from chocolatey, or simply customize the path for the installation, and then pass the full path to the Python executable, like this:
\\server\share\python-3.6.1.exe /quiet InstallAllUsers=1 TargetDir=%ProgramFiles%\Python3.6 Include_pip=1 Include_test=0 PrependPath=1
%ProgramFiles%\Python3.6\python.exe -m pip install utm

Python not recognised as an internal or external command in windows 7

I have installed python 2.7.11 from this link and then restarted my system. However when I go to cmd and run python --version. It gives me an error that
python not recognized as an internal or external command.
So I try to manually add it to my Path variable I see my python being installed at C:\Python27 so I add someotherpath;C:\Python27 to path variable and reopened windows cmd. But it still gives me the same error.
Is there some other way to get over with this problem.
Thanks
Please run the following command in the command prompt.
echo %PATH%
It should have whatever path you have set manually. Otherwise Open a new Command prompt and try the same command.
Run python
If it is not working after that.
Please kindly check the Python.exe is available in C:\Python or Not ?
Changes in PATH variable do not affect already open programs. Close your command line (or powershell) window and reopen it in order to use new PATH variable.
I got same error there are two ways to solve
1)Try using py --version
2)If py is also not recognised than uninstall python and install it again but select the add to path optionas show in fig this time
Easiest way to fix this is to reinstall Python and check "Add to Path" button during the installation.
Python2.7 contains a scripts that adds location to path for windows.
So running
C:\Python27\Tools\Scripts\win_add2path.py
solved my issue

Environmental path to Python not working?

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.

Install Python package, syntax invalid

I have the familiar problem of not being able to install a Python package, pyautogui; "syntax invalid", with install highlighted:
pip install pyautogui
The explanations I've read are all the same, that this code is to be entered into one of the IDLE windows and not the other. Well I've tried both and the result is the same, syntax invalid.
This is Python 3.4.3 on Windows 7.
As #TigerhawkT3 said in the comments, you are supposed to install from CMD, not the Python Shell. pip is an executable that downloads packages.
As the wikipedia page on pip states:
One major advantage of pip is the ease of its command-line interface, which makes installing Python software packages as easy as issuing one command
So pip needs to be run from the command line.
So how do you use pip?
Since you are on Windows 7 the sure-fire way to run it is to open the start menu, type cmd, and click the first result. Then you will be running command prompt, or CMD for short. I suggest that you run pip -h to display the help for more on how to use pip.
If you have
'pip' is not recognized as an internal or external command,
operable program or batch file.
You need to add the path to your scripts folder (the solution is this SO question).
To take an excerpt, you need to execute
setx PATH "%PATH%;C:\Python34\Scripts".
Note that you need to close and re-open CMD for the change to take effect.
Good luck!
EDIT:
For future reference, if you want to set the environment variable, and Setx isn't working, you should search for Edit the system environment variables. Then go to Environment Variables->(in the second list) Path. Then double click that, and append C:\Python34\Scripts;.

Categories

Resources