An easy_install replacement is pip.
The pip installs packages and managing Python packages.
Let’s try to install packages.
1 2 | $ pip install PyOpenGL_accelerate bash: pip: command not found |
Install the pip package.
The recommended way to use the pip tool is within virtualenv since every virtualenv has pip installed in it automatically.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | [free-tutorials@free-tutorials ~]$ curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 111k 100 111k 0 0 75459 0 0:00:01 0:00:01 --:--:-- 139k [free-tutorials@free-tutorials ~]$ python virtualenv.py my_new_env New python executable in my_new_env/bin/python Installing setuptools............................done. Installing pip.....................done. [free-tutorials@free-tutorials ~]$ . my_new_env/bin/activate (my_new_env)[free-tutorials@free-tutorials ~]$ pip --help Usage: pip COMMAND [OPTIONS] --version show program's version number and exit -h, --help Show help -v, --verbose Give more output -q, --quiet Give less output --log Log file where a complete (maximum verbosity) record will be kept --proxy Specify a proxy in the form user:passwd@proxy.server:port. Note that the user:password@ is optional and required only if you are behind an authenticated proxy. If you provide user@proxy.server:port then you will be prompted for a password. --timeout Set the socket timeout (default 15 seconds) --exists-action <EXISTS_ACTION> Default action when a path already exists. Use this option more than one time to specify another action if a certain option is not available. Choices: (s)witch, (i)gnore, (w)ipe, (b)ackup Commands available: bundle: Create pybundles (archives containing multiple packages) freeze: Output all currently installed packages (exact versions) to stdout help: Show available commands install: Install packages search: Search PyPI uninstall: Uninstall packages unzip: Unzip individual packages zip: Zip individual packages |
Let’s try again with PyOpenGL and PyOpenGL_accelerate packages.
1 2 3 4 5 6 7 8 | (my_new_env)[free-tutorials@free-tutorials ~]$ pip install PyOpenGL PyOpenGL_accelerate Downloading/unpacking PyOpenGL Downloading PyOpenGL-3.0.2.tar.gz (891kB): 891kB downloaded Running setup.py egg_info for package PyOpenGL /usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'use_2to3' warnings.warn(msg) .... |
Now we can test these two packages. First is PyOpenGL.
1 2 3 4 5 6 7 8 9 10 11 | (my_new_env)[free-tutorials@free-tutorials ~]$ python Python 2.7.3 (default, Dec 6 2012, 03:02:26) [GCC 4.3.2 20081105 (Red Hat 4.3.2-7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import OpenGL >>> dir(OpenGL) ['ALLOW_NUMPY_SCALARS', 'ARRAY_SIZE_CHECKING', 'CONTEXT_CHECKING', 'ERROR_CHECKING', 'ERROR_LOGGING', 'ERROR_ON_COPY', 'FORWARD_COMPATIBLE_ONLY', 'FULL_LOGGING', 'FormatHandler', 'MODULE_ANNOTATIONS', 'PlatformPlugin', 'SIZE_1_ARRAY_UNPACK', 'STORE_POINTERS', 'UNSIGNED_BYTE_IMAGES_AS_STRING', 'USE_ACCELERATE', 'WARN_ON_FORMAT_UNAVAILABLE', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', 'plugins', 'sys', 'version'] |
…and PyOpenGL_accelerate:
1 2 3 4 5 6 7 | (my_new_env)[free-tutorials@free-tutorials ~]$ python Python 2.7.3 (default, Dec 6 2012, 03:02:26) [GCC 4.3.2 20081105 (Red Hat 4.3.2-7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import OpenGL_accelerate >>> dir(OpenGL_accelerate) ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', '__version_tuple__'] |
This is working only on my_new_env.
That is all for now. I will try to do some examples with these packages.