I just tried to install pygame for python 3.4 my windows computer, but apparently I need to extract the whl file? I have seen other questions like this one on stackoverflow and it says to write in commant prompt:
pip install package-name.whl
However, when I tried this, I got in return:
'pip' is not recognized as an internal of external command, operable program, or batch file.
Is this because I have Windows 10? Please help!
For me this command works.->py -m pip install -U pygame --user
But first, make sure you properly configure your environment variables.
This tutorial http://www.aaronstannard.com/how-to-setup-a-proper-python-environment-on-windows/ will help you how to setup environment variables for python, make sure you do it correctly only step 2 ,no need to do any other steps from this tutorial, now you can follow my steps that were listed below. I will assume that you have already installed python in your computer
Step1
Search for cmd and Right click on cmd and do run as administrator.
Step2
Run the command, py -m pip install -U pygame --user, but before you run this command first of all make sure you configure your environment variables properly.
Step3
Type python in command prompt, this will take you to the python command line which will look like this ">>>".If not then you have a problem with your system variables.
Step4
Make sure you are in python command line and then type import pygame,and after this press ctrl+z and enter that will take you out from python command line.
Step5
Make sure you are not in python command line and then run this command py -m pygame.examples.aliens,if the game starts then congrats you are done.
It can be possible that the pip/ wheel is not installed
follow this link to install pip link
If already installed maked sure it is updated if not
You can use this code to update: python –m ensurepip –-upgrade or pip install --upgrade pip
To install wheel pip install wheel or upgrade pip install wheel --upgrade
once this is done you are good to install pygame
At the command line, make sure you’re in the same directory as the .whl file and run
pip install package-name.whl
The issue is your pip isn't working correctly. To make sure it works, go to this folder C:\Python34\Scripts in windows explorer, hold shift and then right click. press 'open command prompt' here and then try to run pip.
That error occurs when the command entered, pip in this case, isn't found.
I just got pygame working on Windows 10 with these steps.
Download pygame-1.9.2a0-cp35-none-win32.whl from UCI.
Run the cmd shell and enter
> cd C:\Users\<me>\AppData\Local\Programs\Python\Python35-32\Scripts
> pip install C:\Users\<me>\Downloads\pygame-1.9.2a0-cp35-none-win32.whl
Start the Python 3.5 console. Therein enter
import pygame
dir(pygame)
No errors from either means that Pygame is ready for your command.
pip install pygame
that's all you need, just remember to use it correctly in your code
assuming that you have pip installed. You can run:
pip install pygame
in command prompt or a simulated terminal.
If you don't have pip already installed, please refer to this: (hope I helped!)
https://www.makeuseof.com/tag/install-pip-for-python/
I updated my pip, then ran the command prompt (cmd) as adminstrator, then I issued a python command:
-m pip install pygame
And it installed pygame.
Related
Introduction
After I installed atom into my debian-ParrotOS for coding python. I've tried to search for flake8 for helping me to figure out the problems while writing code.
The Problem
after I installed linter-flake8 using this command: pip install flake8
It showed me that this line:
[Linter] Error running Flake8
See console for more info
What I've done
I tried several times to re-install linter-flake8. Even I tried to search multiple times for another alterative but all of them was not effcient as linter-flake8.
Fix Linter flake8
Description:
This's the solution for fixing the console problem which we're facing when we decide to install Linter-flake8 for Python3. It has been tested in Linux and Debian.
Why Linter-flake8 doesn't work after installation?
Linter-flake8 default installation meant to be for python 2.7 beside if you read the description of the package, you will also find that their implementation was for python 2.7 not for python3.
Default installation package simulates directly with python 2.7, not for python3. so, you have to install the package using the commands of python3.
Even after inserting your Executable PATH will be only mere of spectacular. Because you need to install flake8 in terms of python3, not python2.
So, What should I do?
Install Linter-flake8 From Atom and then restart your IDE.
Check if it's actually being installed via your package manager by executing: which flake8 in your terminal.
Reopen your IDE and click Ctrl+Shift+P to open the Search in Atom.
Search for Application: Open the Init Script.
Then, Write in the init.coffee this code:
process.env.PATH = ['usr/local/bin/', process.env.PATH].join(':')
Go To your *Executable PATH and paste this path /usr/local/bin/.
Then, open a new Terminal and execute these commands:
First, enter your root Mode by sudo su.
Second, go to cd /usr/local/bin/.
Third, execute these commands:
python3 -m pip install flake8.
ls
apm install linter-flake8
ls
python3 -m pip install flake8-docstring
python3 -m pip install hacking
If you didn't install pip before, then you can install it by sudo apt-get install pip and then, you can move on to continue the installation of flake8.
close your Atom and open it.
If you want to disable The Max Line Lenght you can do that by Default: 0.
Smile!
It will be a courtesy from you if you start following me :) <3
References:
flake8 not found
linter-flake8
I have multiple instances of python in my computer namely python27, python3.6 and python 3.7.
The import module for docx worked daily on python27 until suddenly it stopped working today. I tried installing the module again using pip in windows command line.
It says only installed in python27 directory. But there's an
importError on my script.
I guess I should be high time i transferred into python37 but I can't seem to make pip install into python 3.7
Can someone offer some advice as to the messy situation I'm in?I want to transfer to python3 and install docx in python3
Already checked modules using pip and docx is not there.
You should try setting your command prompt on the version of Python you want the module to install. Then, just use "pip", to install.
This is how you can do this:
Go into File Explorer (hopefully you have windows) and press and hold the shift key, then right click the folder that you want command prompt to look at. In this case, the folder with the version of Python. Then you click on the command prompt selection, and you're golden. Just use "pip install xyz" from there on. Glad to help
- BURAK ILOGLU
for python 3 try below given approaches.
sudo apt-get install python3-pip
this should get you pip3 and you can use pip3 to install packages specific to python3
and also
python3 -m pip install <package name>
I'm having trouble importing plotly using pip install. The error I get is as follows:
The following command must be run outside of the IPython shell:
$ pip install plotly
The Python package manager (pip) can only be used from outside of IPython.
Please reissue the `pip` command in a separate terminal or command prompt.
I'm very new to programming, so I simply tried this in the windows command prompt and it said "pip is not recognized as an internal or external command, operable program, or batch file". I'm using Spyder if that helps, but I'm not sure what I'm missing here.
Thanks for your help.
I guess you forgot to put ! before pip.
try:
!pip install plotly
in your notebook, should work.
For windows the cleanest way to install a python package is to:
python -m pip install [packagename]
This removes the ambiguity if pip is added to the path variable or not.
If you are getting below error while installing any python packages in window using command "pip install packageName".
The following command must be run outside of the IPython shell:
$ pip install configobj
The Python package manager (pip) can only be used from outside of IPython.
Please reissue the `pip` command in a separate terminal or command prompt.
See the Python documentation for more information on how to install packages:
https://docs.python.org/3/installing/
solution: add "!" at beginning of pip
!pip install configobj(packageName)
It will work. It worked in my case.
What worked for me was going to the directory in which Spyder is located, which you can do by searching Spyder on your computer and then right clicking → directory, and then in the directory opening the Anaconda Prompt. In this Prompt you can type in:
pip install [packagename]
and it will work.
I am trying to install TensorFlow. The installation instruction for Windows (https://www.tensorflow.org/install/install_windows) have as first step to install Python 3.5.2. And I'm doing the 'TensorFlow with CPU support only'.
Python was successfully installed in my computer as I can run it via the Start menu.
However, when I try to do the 2nd step of the installation instructions in order to install TensorFlow, this step says to:
To install TensorFlow, start a terminal. Then issue the appropriate pip3 install command in that terminal. To install the CPU-only version of TensorFlow, enter the following command:
C:\> pip3 install --upgrade tensorflow
But I'm getting an error when I perform the above statement, the error is
'pip' is not recognized as an internal or external command, oprable program or batch file.
I looked at several postings in StackOverflow and tried the commands provided in one of the postings, but I would get the same type of error.
So, how is 'pip3' installed? from what I read, it is supposed to be installed together with the installation, but obviously that did not happen.
How do I install it? I need to install TensorFlow and it seems that it needs to be done via the pip3 installation tool.
Thank you in advance for your help!
Either set the system environment path variable to include the python 3.5.x path in it, or just cd into the correct python folder to run pip3 from there.
The folder in windows 10 should be something like this:
C:\Users\YOUR_USERNAME\AppData\Local\Programs\Python\Python35\Scripts
Open the terminal, cd to that path (change YOUR_USERNAME to the correct user) and then just run the following command:
pip3 install --upgrade tensorflow
and if you want the gpu version:
pip3 install --upgrade tensorflow-gpu
Pip3 is already installed when you install Python, so there is no need to do anything else.
I have installed python 3.5 on my Windows 7 machine. When I installed it, I marked the check box to install pip. After the installation, I wanted to check whether pip was working, so I typed pip on the command line and hit enter, but did not respond. The cursor blinks but it does not display anything.
Please help.
Regards.
Add the Script folder of python to your environment path
or you can do this from command line:
python -m pip install package-name
go the windows cmd prompt
go to the python directory
then type python -m pip install package-name
run it at the cmd window, not inside the python window. it took me forever to realize my mistake.
I was having the same problem on Windows 10, This is how I fix it:
Click the search icon and type System Environment
In System Properties click on Environment Variables
In System Variables tab click New
Enter PYTHON3_SCRIPTS for the variable name and C:\Users\YOUR USER NAME\AppData\Local\Programs\Python\Python38-32\Scripts for Variable Value. Don't forget to change (YOUR USER NAME) in the path with your user, And to change your Python version or just go to this path to check it C:\Users\YOUR USER NAME\AppData\Local\Programs\Python
Click OK
Click NEW again!
Enter PYTHON3_HOME for the variable name and C:\Users\YOUR USER NAME\AppData\Local\Programs\Python\Python38-32\ for Variable Value. Don't forget to change (YOUR USER NAME) in the path with your user, And to change your Python version or just go to this path to check it C:\Users\YOUR USER NAME\AppData\Local\Programs\Python
Click OK
Find Path in the same tab select it and click Edit
Click New and type %PYTHON3_SCRIPTS% Then click OK
Now, everything is set. Restart your Terminal and pip should be working now.
I had the same problem with Version 3.5.2.
Have you tried py.exe -m install package-name? This worked for me.
As soon as you open a command prompt, use:
python -m pip install --upgrade pip
then
python -m pip install <<package-name>>
If you are working in Pycharm, an easy way is go to file>setting>project interpreter. Click on the + icon you will find on right side probably and then search and install required library.
For those with several python versions of python 3 installed in windows: I solved this issue by executing the pip install command directly from my python35 Scripts folder in cmd...for some reason pip3 pointed to python 34 even though python 35 was set first in environmental variables.
I had the issue, and answered this same question sometimes ago. Do open a cmd if in windows OS or linux OS with admistrative privilege. Then python -m pip install --upgrade pip
then
python -m pip install <>
Working on windows and above version than 3.0
First upgrade pip to pip3 by following command:
pip3 install --upgrade setuptools pip
Then install maximum package by following command:
pip3 install <package_name>
I never wrote all package because some package not support to pip or pip3 command.