Can't install pillow module - python

I have been working on a small rpg game by using python. I want a picture to pop up during the last boss and I have been told that is possible by using pillow. While trying to install it via this code:
pip install pillow
I get an error that states:
'pip' is not recognized as an internal or external command, operable program or batch file.
What am I supposed to do?

The issue is that the pip script by Python is not found by Windows. The reasons may be:
Improper installation of Python (leading to the file not being on your device)
PATH variable not set properly (leading to the inability of Windows to recognize pip, even if it is present on your device)
Verify if the script is present in your Python installation folder. The default path for pip and other scripts is C:\Users\<username>\AppData\Local\Programs\Python\<version>\Scripts
If there is a pip.exe file in that, just add the full path of the Scripts folder to the Windows PATH variable. Check out this link if you need help with setting the PATH variable
If the file is absent, I recommend a clean re-install of Python on your PC (just to ensure all files are present)

Related

Adding python to PATH system variable still does not prevent 'pip' from not being recognized

I understand that this issue arises when you have not added the python path to the PATH system variable. However, I have added the path of the python executable to the PATH system variable (as when I installed python there is no python folder that has been installed onto my computer). After doing this, I am still not able to install psychopy using pip, as I am getting the same error as before.

PIL (Pillow) module install issue

I have been attempting to install the Pillow (PIL) module into my python(3.8.2) using Windows 10 to no success.
I have tried executing pip install Pillow as mentioned by the website in my cmd but both pip and python are 'not recognised as an internal or external command, operable program or batch file'
What I have tried:
Reinstalled both pip and python and tried again, with the same problem.
Using powershell instead of command prompt (not sure if that makes any difference).
Also I understand you can download the Pillow module package in .whl, but I couldn't work out how to install it that way.
I have also installed pygame using the cmd before which baffles me as to why this is happening.
Any and all help is appreciated, Thank you!
If you're sure that you've successfully installed python, but it's not working on your commandline, it may not be in your PATH. Open the search in the windows start menu, and type "env" and click on "Edit Environmental Variables for your system (or choose account if you don't have admin on the system). If you chose system, click on the environmental variables button. You will then be greeted by one window split into two menus, User Variables and System Variables. Scroll down in the User variables and double click on Path.
Go find the location of your python install with the python.exe file in it (you could search for it in your C:\ if you're willing to wait). Add that path to the Path variable list.
If you can't find the python.exe or just don't want to wait, reinstall your python installation and look for a checkbox with "Add to Path" or something along those lines.
In addition to the python.exe being in your path, make sure to add the "Scripts" folder in your path. It should be a subfolder in the same folder as python.exe.
For windows 10 install PIL and cImage.
Install Python 2.7.8 (64-bit — this is important)
https://www.python.org/ftp/python/2.7.8/python-2.7.8.amd64.msi
Install Python 3.4.1 (64-bit — this is important)
https://www.python.org/ftp/python/3.4.1/python-3.4.1.amd64.msi
Download and install Pillow for Python 2
https://pypi.python.org/packages/2.7/P/Pillow/Pillow-2.5.3.win-amd64-py2.7.exe#md5=33c3a581ff1538b4f79b4651084090c8
Download and install Pillow for Python 3
https://pypi.python.org/packages/3.4/P/Pillow/Pillow-2.5.3.win-amd64-py3.4.exe#md5=6ee659d7b945e826a07c53c15578424f (direct link)
https://pypi.python.org/pypi/Pillow/ (all other versions)
Download and install cImage
Navigate to https://github.com/bnmnetp/cImage
Click cImage.py, and click the button labeled Raw to see the contents of the file.
Click File > Save Page As (Chrome & Firefox) or File > Save As (Safari) to save the file on your computer.
Copy “cImage.py” from where you saved it to C:\Python27\Lib\site-packages and C:\Python34\Lib\site-packages\

"python" and "pip" command not found in Command Line [duplicate]

This question already has answers here:
How to add to the PYTHONPATH in Windows, so it finds my modules/packages?
(23 answers)
Closed 5 years ago.
I recently installed Python 3.6 for my Windows 10 (64bit) and I want to use pip, but before to install that, I need to execute the following command using the downloaded get-pip.py program:
python get-pip.py
Somehow this doesn't work and I get the following message from Command Line:
'python' is not recognized as an internal or external command,
operable program or batch file.
(I get the same message when I want to execute some pip commands)
I tried a lot of "solutions" for installing pip, like downloading files from https://bitbucket.org/pygame/pygame/downloads/ but nothing happened, I got the messages...
Could you explain to me why the Command Line doesn't know these commands and how can I install them?
No need for admin access:
The reason the error is arising is because python is not in your PATH (meaning it can be called from any directory in the prompt). You can check that its not in the PATH by typing the following:
echo %path%
which will return lost of different directory paths, but not the one to where you have python installed.
To add python to this (and get rid of your error), follow these steps:
Open up control panel.
Go to System. (skip to this step with: Win+Break )
Go to the Advanced tab at the top.
Click on Environment Variables at the bottom.
In the section User variables for ___, add a new one with New.
In this pop-up add the name : path and value : C:\Python34 (or wherever it is installed).
Hope this helps as this is what I did to get python to work from any directory in the command prompt!
Open your CMD as administrator and type PATH (prints the output of your system PATH Variable). There have to be a PATH directing to your Python Installation directory. Only with that system Path your cmd knows where python.exe is and search there for python.
Normally the Python Installation Setup asks if you want to set a Python Environment PATH Variable. Maybe run the setup again and watch out for that option. And I think there was a checkbox to automatic install pip for python.
If you want to set the Path Environment Variable use this:
https://superuser.com/questions/949560/how-do-i-set-system-environment-variables-in-windows-10
If you want to manually install pip with GET-PIP you have to download get-pip.py first and then run it with python.
Download get-pip from here.
https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py
Could you explain to me why the Command Line doesn't know these
commands and how can I install them?
This happens when Python executables are not added to PATH.
#xyres provided a nice link on how to do this.
I want to use pip, but before to install that, I need to execute the following command
using the downloaded get-pip.py program:
pip should be bundled with the official Python installer, so there should be no need to get it from other sources

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