I was looking for a tutorial on how to install Python libraries in the wheel format.
It does not seem straightforward so I'd appreciate a simple step by step tutorial how to install the module named "requests" for CPython.
I downloaded it from: https://pypi.python.org/pypi/requests and now I have a .whl file. I've got Python 2.7 and 3.3 on Windows, so how do I install it so all the other Python scripts I run can use it?
Have you checked this http://docs.python.org/2/install/ ?
First you have to install the module
$ pip install requests
Then, before using it you must import it from your program.
from requests import requests
Note that your modules must be in the same directory.
Then you can use it.
For this part you have to check for the documentation.
i have write the answer here How to add/use libraries in Python (3.5.1) but no problem will rewrite it again
if u have or you can create a file
requirements.txt
which contains the libraries that you want to install for ex:You gonna situate in your folder which contains that
requirements.txt
in my case the path to my project isnow just type
and all the libararies that you want gonna install
You don't need to download exclusively from the website. Just make sure you have pip (which you probably will if you have python installed). Just open your Command Prompt (CMD) and run the command:
It will automatically download the correct whl version of pygame compatible with your configuration of PC. Make sure you remember the version which appears while "downloading" as this is the compatible version of .whl packages you shall be looking for in the future.
Install distribute by downloading and running distribute_setup.py. This will make easy_install available, and from there you can install pip with easy_install pip. Then you can run pip install CAGE. Using pip to install things is a lot easier than messing with manually running setup.py, because pip can do things like:
If you're on Windows, the one downside of pip occurs when there are C library dependencies, as pip will want a C toolchain installed so it can compile things. If that is the case, then there are two options. If there are precompiled binaries on PyPI, then just run easy_install package instead; easy_install knows how to use binary packages. You can also check Christoph Gohlke's site for executable installers of many binary packages. These can also be installed by easy_install if you want to use them with a virtualenv (just point it to the path of the .exe) or you can click and run if you don't care about virtualenv.
The main point is that no matter what route you choose to install packages, at no point are you ever moving around files by hand. You need to get out of the mindset of "I extracted this archive, where do I put these .py files?" That's not how it works. You're either running pip, running easy_install, running setup.py, clicking on an installer package, or using your distribution's installer. At no point are you ever doing anything by hand with the files directly.
Simple steps to install python in Ubuntu:
Download Python
Extract the downloaded package
Compile Python source
Note
make altinstall
is used to prevent replacing the default python binary file/usr/bin/python
.check the python version
If you want to be relax for installing libraries for python.
You should using
pip
, that is python installer package.To install pip:
Download ez_setup.py and then run:
Then download get-pip.py and run:
upgrade installed
setuptools
by pip:If you got this error:
Add
--no-use-wheel
to above cmd:Now, you can install libraries for python, just by:
For example:
Note that to install some library may they need to compile, so you need to have compiler.
On windows there is a site for Unofficial Windows Binaries for Python Extension Packages that have huge python packages and complied python packages for windows.
For example to install
pip
using this site, just download and install setuptools and pip installer from that.