Install mechanization with easy_install

I just downloaded easy_install, but I had problems installing the mechanization, should I visit the package sites at any time. In the first attempt below, I got an error. in the second attempt below, I got a command that was not found, which is wierd, as I know for sure that it is loaded.

names-computer:~ names$ cd /Users/names/Desktop/ names-computer:~/Desktop names$ sh /Users/names/Desktop/mechanize-0.1.9-py2.5.egg /Users/names/Desktop/mechanize-0.1.9-py2.5.egg: /Users/names/Desktop/mechanize-0.1.9-py2.5.egg: cannot execute binary file names-computer:~/Desktop names$ easy_install mechanize -bash: easy_install: command not found 
+6
python easy-install mechanize
source share
4 answers

On OS X, Python interpreter instances are usually installed as the so-called Framework assemblies, which means that the bin directory exists in the structure, which usually (but not always) is the installation location for python scripts such as easy_install . If you are not using the supplied Apple python (at / usr / bin /), which has its own easy_install instance, you must make sure that the bin bin directory of the desired python is located in PATH to search for the shell and precedes /usr/bin . In particular, if you are using python installed by the python.org installer, your PATH should look something like this:

 $ echo $PATH /Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin 

This ensures that the correct easy_install is found first. If you are using Python for MacPorts, it should look like this:

 $ echo $PATH /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin:/opt/local/bin:/usr/bin:/bin 

EDIT: By the way, the egg you downloaded for Python 2.5, and judging by the previous question, you can use it with python 2.6. If you just use the command

 $ easy_install mechanize 

he should automatically load the proper egg, if available, or source, and complete the necessary assembly and installation steps.

+3
source share
 apt-get install python-setuptools 

This command will install easy_install on Ubuntu.

+11
source share

You do not need to download mechanize to install it with easy_install. You just go:

 /path/to/easy_install mechanize 

Your problem is that you are not actually calling easy_install.

 bash: easy_install: command not found 

This only works if easy_install is installed for standard Python on your system. obviously you installed it for another python. Find out where you actually installed it, and name it using the path. Done!

+2
source share

mechanize-0.1.9-py2.5.egg is just an archived file. In addition, you do not need to load the egg manually. easy_install will automatically extract the code for you and install it.

You can install easy_install using ez_setup.py , the boot script file that they provide.

+1
source share

All Articles