0

I'm quite a newbie to python, and I was trying to install mechanize for python 3.2.5

I looked up where to find it and found this page: https://github.com/adevore/mechanize/tree/python3 which I assume would work with python 3.2.5

However, it says in the install.txt to run "python setup.py install" but does not tell me where to run that code. I tried cmd but it told me: "python is not recognized as an internal or external command, operable program or batch file"

So, instead, I tried the other option it gave me, which was to drag the contents of the mechanize zip file to the site packages folder. That didn't work either.

If anyone could help me install this module, that would be greatly appreciated. Also, I'm using Windows10 64 bit with Python 3.2.5

Jack
  • 17
  • 4
  • Did you try to install it using "pip install mechanize"? See here how to get started with pip: https://pip.pypa.io/en/stable/installing/ – gplayer Apr 07 '16 at 11:48
  • How did you install python? It seems the install never updated your PATH and PYTHONPATH environment variables... Have a look here - http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7 – Ru Hasha Apr 07 '16 at 11:58
  • Any particular reason you are using an old version of python3? Based on *"python is not recognized as an internal or external command* you also have not added python to your environment variables – Padraic Cunningham Apr 07 '16 at 11:58
  • I'm using 3.2.5 because my school uses that and they said to use it in case a program I make errors due to being a different version and I installed python using the installer on the website (x86 msi installer) – Jack Apr 07 '16 at 13:26

1 Answers1

0

If you are getting the error

"python is not recognized as an internal or external command, operable program or batch file"

And you have installed python, then the issue is likely to be that the directory where you have installed python is not in your PATH. (more often than not, python is installed in a folder pythonXX in your C:// Drive)

Get python onto your path

In cmd prompt type in %PATH%. And confirm that the directory is not there.

To place directories into the path run this commands in command prompt, replacing pythonXX with the directory where you have python installed.

set PATH=%PATH%;C:\pythonXX

To make this change more permanent, i suggest you read this article by How-To-Geek.

After you've placed the python directory into your path, test that python does indeed now run from cmd prompt by typing python into cmd prompt and you should see something like this

Python 3.2.25 (default, Oct 19 2015, 18:04:42) 
>>> 

go nuts :D

Time to install mechanize tree

now get back out of the python interpreter (type in exit or ctrl-d) and make your way towards the directory where mechanize tree is based (use the cd command to move directories and the dir command to list the contents of directories)

Once in there run the command

python setup.py install

and it should work like a charm :)

Priyav Shah
  • 111
  • 1
  • 6
  • Hi, so I decided to try and install pip first but when I ran python get-pip.py it came up with this error: https://gyazo.com/7f426ae26eea7050ea597eabf14f186f any help? I've tried reinstalling python and using ccleaner to clean my temp folder but that hasn't worked. – Jack Apr 08 '16 at 11:10
  • hmmm, is it for python version 3.2 to that you are installing pip? It states on the first line of the error **"User warning: Versions 3.0 -3.2 have been dropped, future versions will fail here"** – Priyav Shah Apr 09 '16 at 15:05
  • btw, were you able to install mechanise tree through the method above? – Priyav Shah Apr 09 '16 at 15:09
  • Hi, I found a pip for 3.2 so that doesn't matter any more, but mechanize didn't work, although I think it's probably because 3.2 wasn't supported for the version I tried. – Jack Apr 12 '16 at 15:41