开发者

installing mechanize with easy_install

开发者 https://www.devze.com 2022-12-18 05:49 出处:网络
I just got easy_install downloaded but i\'m having problems installing mechanize, should I be addressing site-packages at any point. In the first try below, i got an error. in the second try below, i

I just got easy_install downloaded but i'm having problems installing mechanize, should I be addressing site-packages at any point. In the first try below, i got an error. in the second try below, i got command not found which is wierd since I know for sure that it downloaded.

names-computer:~ names$ cd /Users/names/D开发者_Python百科esktop/
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


apt-get install python-setuptools

This command will install easy_install on Ubuntu.


On OS X, Python interpreter instances are typically installed as so-called Framework builds which means that there is a bin directory within the framework which is typically (but not always) the installation destination for python scripts, such as easy_install. If you are not using the Apple-supplied python (in /usr/bin/) which has its own easy_install instance there, you should ensure that the framework bin directory of the desired python is on your shell search PATH and precedes /usr/bin. In particular, if you are using the 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

That ensures that the proper easy_install will be found first. If you are using a MacPorts python, 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 that you downloaded appears to be for Python 2.5 and judging from a previous question, you may be wanting to use it with python 2.6. If you just use the command

$ easy_install mechanize

it should automatically download the proper egg, if available, or the source and do the necessary build and install steps.


You don't need to download mechanize to install it with easy_install. You just go:

/path/to/easy_install mechanize

Your problem is that you don't actually call easy_install.

bash: easy_install: command not found

That only works if easy_install is installed for the standard Python on your system. evidently you installed it for some other python. Figure out where you actually installed it, and call it with the path. Done!


mechanize-0.1.9-py2.5.egg is just a zipped file. Furthermore, you don't need to download the egg manually. easy_install will automatically pull down the code for you and install it.

You can install easy_install with ez_setup.py, a bootstrap script they provide.

0

精彩评论

暂无评论...
验证码 换一张
取 消