I'm trying to install wikipedia's basic python package with pip, and I keep getting syntax errors. I'm using pip through the python command line. Attached a screen shot of what I'm trying to do here. Any ideas as to what I'm doing wrong?
Asked
Active
Viewed 231 times
0
-
You do not need the `$` character, that is just the prompt charcter for linux, like `>>>` for IDLE. And `sudo` is a linux command, not windows. – Cory Kramer Feb 13 '15 at 17:38
-
1Why are you trying to run `pip` in the Python interpreter?! – jonrsharpe Feb 13 '15 at 17:39
-
I tried sudo and the $ sign after regular did not work – JonGor Feb 13 '15 at 17:40
-
@JonGor Read my comment above, neither of those apply to windows. – Cory Kramer Feb 13 '15 at 17:42
-
It appears that `pip` is **not** correctly installed for the command line. How precisely did you install it? Please stop posting screenshots, it's much better to provide code-formatted text. – jonrsharpe Feb 13 '15 at 17:50
-
OK, sure. I copied the text from https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py to my python interpreter ( Pycharm) and ran it. I got a "successfully installed" notification. – JonGor Feb 13 '15 at 17:54
-
The Python interpreter and the command line are two very different things. – Feb 13 '15 at 17:58
-
Perhaps take a look at http://stackoverflow.com/q/4750806/3001761 – jonrsharpe Feb 13 '15 at 18:02
3 Answers
2
run it from a cmd
prompt not a python interpreter:
pip install wikipedia
If you don't have pip installed which you don't seem to have then download get-pip.py and run python get-pip.py

Padraic Cunningham
- 176,452
- 29
- 245
- 321
-
-
-
I think so, I can see it at C:\Python27\Lib\site-packages, and also when I run import pip on my python shell it recognizes the command. – JonGor Feb 13 '15 at 17:44
-
@JonGor if you're in the Python shell, run `exit()`, **then** run `pip`. – jonrsharpe Feb 13 '15 at 17:46
-
@JonGor, forget about python. Run pip from a cmd prompt but **install** it first using get-pip.py as in my answer – Padraic Cunningham Feb 13 '15 at 17:49
-
@PadraicCunningham, jonrsharpe - I added a screen shot where I tried to run it from a cmd shell. It still didn't work. I think I have installed it already - how can I make sure that its properly installed? – JonGor Feb 13 '15 at 17:52
-
@JonGor, just install using get-pip.py it will take a few seconds – Padraic Cunningham Feb 13 '15 at 17:52
-
@PadraicCunningham, could you be a little more specific as to what that means? I am new to python, so I do not understand what installing it using get-pip.py means. – JonGor Feb 13 '15 at 17:56
-
@JonGor, have you looked at my answer? I provided the link and how to install it – Padraic Cunningham Feb 13 '15 at 17:56
-
@PadraicCunningham, I downloaded and ran the file. It automatically ran through my interpreter (Pycharm), and I got the message "Requirement already up-to-date: pip in c:\python27\lib\site-packages" – JonGor Feb 13 '15 at 18:03
-
-
"'pip' is not recognized as an internal or external command, operable program or batch file" – JonGor Feb 13 '15 at 18:09
-
1
-
1@JonGor you need to add `C:\Python27\Scripts` to your `PATH` environment variable. Then, restart `cmd` and it'll work. – MattDMo Feb 13 '15 at 18:10
-
1
-
-2
You could also download the python install package, extract it, navigate to install.py in CMD and do "python install.py install"

Yeniaul
- 1
- 4