package a python package and its dependencies into an rpm

40 views
Skip to first unread message

Lian Jiang

unread,
Apr 12, 2018, 7:08:54 PM4/12/18
to fpm-users
Hi,

I am new to fpm and have created a sample rpm for a python package using:

fpm -s python -t rpm --python-bin python2.7 --python-easyinstall easy_install-2.7 requests

But I failed to install it:

[vagrant@localhost ~]$ rpm -ivh python-requests-2.18.4-1.noarch.rpm
error: Failed dependencies:
python-certifi >= 2017.4.17 is needed by python-requests-2.18.4-1.noarch
python-chardet >= 3.0.2 is needed by python-requests-2.18.4-1.noarch
python-idna >= 2.5 is needed by python-requests-2.18.4-1.noarch
python-idna < 2.7 is needed by python-requests-2.18.4-1.noarch
python-urllib3 >= 1.21.1 is needed by python-requests-2.18.4-1.noarch
python-urllib3 < 1.23 is needed by python-requests-2.18.4-1.noarch

Since it is tedious and error prone to include all dependencies and their versions, is a way for fpm automatically package the dependencies into the rpm? Thanks for any help!

 

Chris Hemmerly

unread,
Apr 13, 2018, 8:43:38 AM4/13/18
to fpm-users
Tacking this on to your fpm command should do it:
-d "python-certifi >= 2017.4.17" -d "python-chardet >= 3.0.2" -d "python-idna >= 2.5" -d "python-idna < 2.7" -d "python-urllib3 >= 1.21.1" -d "python-urllib3 < 1.23"

-Chris

Lian Jiang

unread,
Apr 13, 2018, 12:08:36 PM4/13/18
to fpm-...@googlegroups.com
Thanks Chris.

It seems not work:

fpm -s python -t rpm --python-bin python2.7 --python-easyinstall easy_install-2.7 -d "python-certifi >= 2017.4.17" -d "python-chardet >= 3.0.2" -d "python-idna >= 2.5" -d "python-idna < 2.7" -d "python-urllib3 >= 1.21.1" -d "python-urllib3 < 1.23" requests
Created package {:path=>"python-requests-2.18.4-1.noarch.rpm"}


[vagrant@localhost ~]$ rpm -ivh python-requests-2.18.4-1.noarch.rpm
error: Failed dependencies:
    python-certifi >= 2017.4.17 is needed by python-requests-2.18.4-1.noarch
    python-chardet >= 3.0.2 is needed by python-requests-2.18.4-1.noarch
    python-idna >= 2.5 is needed by python-requests-2.18.4-1.noarch
    python-idna < 2.7 is needed by python-requests-2.18.4-1.noarch
    python-urllib3 >= 1.21.1 is needed by python-requests-2.18.4-1.noarch
    python-urllib3 < 1.23 is needed by python-requests-2.18.4-1.noarch

Any idea? Thanks.


--
You received this message because you are subscribed to the Google Groups "fpm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fpm-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lian Jiang

unread,
Apr 15, 2018, 8:29:47 PM4/15/18
to fpm-...@googlegroups.com
Thanks for any help!

Chris Hemmerly

unread,
Apr 16, 2018, 3:45:08 PM4/16/18
to fpm-users
I'm at the limit of my knowledge there. I use the -d flags to create dependencies for my C-based applications; maybe the implementation for Python-based packages is different?

-Chris
Thanks for any help!

To unsubscribe from this group and stop receiving emails from it, send an email to fpm-users+...@googlegroups.com.

Lian Jiang

unread,
Apr 16, 2018, 4:36:23 PM4/16/18
to fpm-...@googlegroups.com
I downloaded the requests whl file from pypi and "pip install" worked. This solution seems to be more reliable.

To unsubscribe from this group and stop receiving emails from it, send an email to fpm-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages