This question already has answers here:
Install python wheel file without using pip
(2 answers)
Closed 4 years ago.
I have downloaded .whl and trying to install it. Can you tell me the possible ways of installing wheel without using pip.
For tar.gz files, I executed python setup.py install and it installed my package.
How the same can be done for wheel when there is no setup.py file in it?
.whl: A compressed file like Zip Achieve.
How to install?
Install Winrar or other software that can extract compressed files.
Extract your .whl file in a safe folder.
Add that directory to your Path Variables.
Now everything is done.
It's bad practice to install a .whl file. You should use PIP.
Well, I recommend you to extract your .whl file in that folder where all Python modules are installed.
Related
This question already has answers here:
How to install packages offline?
(12 answers)
Closed 5 months ago.
I am not able to use PIP on this device, so I need to install a module manually. The only problem is that I have to install like 30 dependencies of this module. I would have to download, unzip, include and install them all one by one.
Is there any faster way, like downloading a module with all its dependencies included?
If all requirements are pip packages, a quick solution might involve creating a lean python environment on another machine, installing the package using pip, and then copying over all of the resultant wheel files to the restricted machine either via SSH or another method.
This question already has answers here:
How to install packages offline?
(12 answers)
Closed 3 years ago.
I'm an experienced programmer, but very new to python. My company requires us to do development on a private network for some of our projects. There is a pypi index on the private network which can be used to install packages using pip. Recently, while needing to install a package, the pypi index when down and was down for several hours. Although it did come back up eventually, the situation begs the question, how do I install packages (maybe manually without pip) in the absense of an index? I've tried to google this, but came up empty. I'm sure there's a way, but I'm probably not searching for the right phrase. Thanks for any help with.
You can manually install Python packages if you have read access to the package repositories. Every Python package has a setup.py file in the root directory and you can do something like
python setup.py sdist
This creates a subdirectory called dist which contains a compressed archived file, tar.gz or .zip depending in your OS. You can pass this archived file to pip and install the package
pip3 install some-python-package.tar.gz
I would download the wheel and install that. For this to you do need to install the wheel package:
pip install wheel
You can then tell pip to install the project (and it'll download the wheel if available), or the wheel file directly:
pip install project_name # download and install
pip install wheel_file.whl # directly install the wheel
The wheel module is also runnable from the command line and you can use it to install already-downloaded wheels:
python -m wheel install wheel_file.whl
There are a few ways you can get around this issue. The two that I know of are:
Use a proxy to get to the standard PyPI. If your company permits it, then you can tunnel your traffic through their proxy and install packages from PyPA's standard locations.
Use a locally hosted index. All you need is a directory structured like https://pypi.org/simple/, and you can then pip install -i ~/my/personal/index/path and packages will be installed from there.
This question already has answers here:
How to install Python packages from the tar.gz file without using pip install
(7 answers)
Closed 5 years ago.
I have downloaded the tar file of the Python geohash package
I import functions from this package to use them inside my python programs. It works completely fine, but only inside its own folder, where it is extracted.
If I intend to use this package in any other location, it doesn't simply import that package.
What should I do if I want to use it anywhere in my system ?
(the package is only available through this tarfile, not through pip/sudo apt-get)
Simply untar/unzip the file and make sure you have setup.py visible. From you command prompt in windows or linux. Go to the dir of the package which you just unzipped/untarred and dir/ls to make sure that setup.py is there and then do the following:
If you are using virtualenv:
/path-to-your-venv/venv/bin/python setup.py install
If you are not using virtualenv
python setup.py install
The instructions for Windows ask to download the installer from
http://www.lfd.uci.edu/~gohlke/pythonlibs/
The link for my version displays as "Shapely‑1.5.13‑cp27‑none‑win_amd64.whl".
However it is actually a zip file, which contains 2 folders, neither of which appear to contain a .whl file or an installer.
Note that the question is not about how to install a .whl file, but why I can't see a .whl file.
How do I install this?
The file is a .whl, you can install it by running
pip install ___.whl
This question already has answers here:
How to easily distribute Python software that has Python module dependencies? Frustrations in Python package installation on Unix
(2 answers)
Closed 5 months ago.
I wish to package a utility that I have created that depends on Pillow, a port of the Python Imaging Library. Is there a way to include Pillow in my own package or to automatically install Pillow upon running the setup script?
Python 3 mainly uses pip for installing packages. This is based off of setuptools and distribute. You would create the setup.py script with the requirement specified. The easiest way is to create a requirements file using pip. http://codeinthehole.com/writing/using-pip-and-requirementstxt-to-install-from-the-head-of-a-github-branch/
Command Line:
pip freeze > requirements.txt
setup.py
import setuptools
from pip.req import parse_requirements
requirements = [str(ir.req)
for ir in parse_requirements("requirements.txt", session=uuid.uuid1())
if ir.req is not None]
setuptools.setup(..., install_requires=requirements)
If you want to build an executable then the process if fairly similar to the standard setup.py file approach only you use cx_freeze.