How to install Python packages from the tar.gz file without using pip install
Thanks to the answers below combined I've got it working.
- First needed to unpack the tar.gz file into a folder.
- Then before running
python setup.py install
had to point cmd towards the correct folder. I did this bypushd C:\Users\absolutefilepathtotarunpackedfolder
- Then run
python setup.py install
Thanks Tales Padua & Hugo Honorem
How to install tar.gz package to Yocto by adding new layer?
First, before answering your questions
Let me mention some best practices advice for you:
Rename the recipe to some significant name related to you compressed package.
Naming the recipe to mylayer
confuses Yocto users, because there is the term layer
also.
Regarding you recipe:
There is no need for FILESEXTRAPATHS
because the recipe path is added automatically to Yocto paths.
FILESEXTRAPATHS
it is required for .bbappend
files.
You need to override the do_install
task function, it does nothing by default.
do_install
is the first essential task to make sure that your sources are included in the final image.
Beside that, when specifying a compressed source file into SRC_URI
, yocto automatically decompresses it.
This is mentioned here.
So, here what your recipe should look like:
SUMMARY = ""
LICENSE = "CLOSED"
# Prevent Yocto from decompressing the file
SRC_URI = "file://mypackage.tar;unpack=0"
do_install(){
# Create the opt folder into the final image, ${D} is ${WORKDIR}/image
install -d ${D}/opt
# Copy the compressed file there; You can change permissions as you want
install -m 0755 ${WORKDIR}/mypackage.tar ${D}/opt
}
# Very important to specify what you installed in (do_install)
FILES_${PN} = "/opt/*"
Now, when you run IMAGE_INSTALL_append += " mylayer"
your file will be installed.
Regarding your questions:
You mentioned that your compressed file contains
.deb
files, I assume that no license checksum is needed. Also, I understand that you may wanted to point toSRC_URI[md5sum]
or other checksums for the full package. That is also not needed for local files, it is used to check for the integrity of online sources.PACKAGE_CLASSES
as mentioned here, is used by the system to know in what type the data should be packaged. Bythe data
I mean the data that you installed withdo_install
. That data get packaged for according to yourPACKAGE_CLASSES
variable, for example, todeb
file. And that is used, along side with all other recipes packages, to build the final rootfs.Yes, if you are installing the
tar
file into the image and then unpack it to install alldeb
files, for example, withdpkg
. You can use thebin_package
class to do that, now the recipe must be changed for that reason:
Decompress the
tar
file and provide thedeb
files in the localfiles
folder.Add all
deb
files toSRC_URI
Inherit the
bin_package
classSpecify the files to be packaged.
Your recipe should look like this:
SUMMARY = ""
LICENSE = "CLOSED"
SRC_URI = "file://deb_file1.deb \
file://deb_file2.deb"
# No need to `do_install` , it is invoked by the (bin_package) class
FILES_${PN} = ""
Important:
About FILES_${PN}
, you need to add all what the deb installed into the image folder
Example, if your deb file installs this:
/usr/bin/hello
/etc/hello.cfg
Specify them:
FILES_${PN} = "/usr/bin/*"
FILES_${PN} += "/etc/*"
Use *
so if other deb
files install files into the same folder as others it will include all.
installing a python package from tar.gz
Since you are running Ubuntu, simply run sudo apt-get install python-cvxopt
I can install it this way on 16.04. Not sure what version you are running.
It does look like the compiler (gcc) is complaining because you are missing dependencies (blas). Installing via the package manager should solve your issues.
Installing downloaded tar.gz files with pip
You can install tar.gz with pip Install a particular source archive file.
pip install ./Package-1.0.4.tar.gz
You can also install it with extracting tar.gz file. First you should extract it using using tar command.
tar -xzvf PyGUI-2.5.4.tar.gz
cd PyGUI-2.5.4.tar.gz
And then use the setup.py file to install the package .
python setup.py install
or
sudo python setup.py install
( use sudo only in linux )
Source: https://pip.readthedocs.io/en/stable/reference/pip_install/#git
R: make not found when installing a R-package from local tar.gz
what do you need is to update the Rtool, here is the link I had the same issue before once you update it will work.
Batch install RPM packages from .tar.gz file on CentOS
You have to untar the file and the install them with rpm
tar xfz file.tar.gz
rpm -i *rpm
There is no way for rpm to install RPMs from standard input.
Otherwise there is a archivemount to mount the tarball (see https://superuser.com/questions/265772/is-it-possible-to-mount-a-tar-file).
Related Topics
How to Use With/Within Inside a Function
Error in If/While (Condition):Argument Is Not Interpretable as Logical
Plot with Ggplot in For-Loop Doesn't Work
Create a Histogram for Weighted Values
How to Place Legends at Different Sides of Plot (Bottom and Right Side) with Ggplot2
How to Save the Wordcloud in R
Installing Ggplot2 Package on Ubuntu
Factor with Comma and Percentage to Numeric
Arranging Rows in Custom Order Using Dplyr
Replace Values in Data Frame Based on Other Data Frame in R
Additional Metrics in Caret - Ppv, Sensitivity, Specificity
Extract Last Non-Missing Value in Row with Data.Table
How to Calculate Total Least Squares in R? (Orthogonal Regression)
How to Rbind Only the Common Columns of Two Data Sets
Multiple Y Axis for Bar Plot and Line Graph Using Ggplot
Converting Yearmon Column to Last Date of the Month in R
Calculate Percentage for Each Time Series Observations Per Group in R