Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtual environment not in deb #168

Closed
benman1 opened this issue Aug 25, 2016 · 6 comments
Closed

virtual environment not in deb #168

benman1 opened this issue Aug 25, 2016 · 6 comments

Comments

@benman1
Copy link

benman1 commented Aug 25, 2016

Hi,
thanks for this tool. I've watched the intro talk on youtube, went through the tutorial, and a lot of what I could find online. This is the first time I am building a deb package, and I am not sure I understand the mechanics behind it yet. I am working with python3.4 which maybe makes it a bit more complicated. My problem is that the virtual environment does not seem to be included when I run dpkg -c package-name.deb.

After patching up pyversions to return python3.4 (it doesn't return anything otherwise), I can run the install with different rules such as these:

%:
        dh $@ --with python3 --builtin-venv

or

%:
        dh $@ --with python3 --builtin-venv --buildsystem=pybuild

or

%:
        dh $@ --with python3

I've tried a lot of things already. It does download python packages in some of these configurations, however I never see them in the deb.

Please help!

@FlogFr
Copy link

FlogFr commented Aug 26, 2016

Have you tried to add python-virtualenv in your --with argument?

For instance my debian rules looks like this:

%:
    dh $@ --with systemd,python-virtualenv

override_dh_virtualenv:
    dh_virtualenv --setuptools --python /usr/bin/python3

@benman1
Copy link
Author

benman1 commented Aug 30, 2016

Hi again!
thanks for that. It goes much further now in the build process. However, now I have problems integrating scikit learn:

   dh_strip
[...]
strip --remove-section=.comment --remove-section=.note --strip-unneeded debian/packagename/usr/share/python/packagename/lib/python3.4/site-packages/sklearn/linear_model/sgd_fast.cpython-34m.so
Not enough room for program headers, try linking with -N
BFD: debian/packagename/usr/share/python/packagename/lib/python3.4/site-packages/sklearn/linear_model/stSBnUjs: Not enough room for program headers, try linking with -N
strip:debian/packagename/usr/share/python/packagename/lib/python3.4/site-packages/sklearn/linear_model/stSBnUjs[.note.gnu.build-id]: Bad value
BFD: debian/packagename/usr/share/python/packagename/lib/python3.4/site-packages/sklearn/linear_model/stSBnUjs: Not enough room for program headers, try linking with -N
strip:debian/packagename/usr/share/python/packagename/lib/python3.4/site-packages/sklearn/linear_model/stSBnUjs: Bad value
dh_strip: strip --remove-section=.comment --remove-section=.note --strip-unneeded debian/packagename/usr/share/python/packagename/lib/python3.4/site-packages/sklearn/linear_model/sgd_fast.cpython-34m.so returned exit code 1
make: *** [binary] Error 29
dpkg-buildpackage: error: debian/rules binary gave error exit status 2

I am not sure how to resolve this. I'll be trying a bit more - feedback appreciated.

As a comment, I had to make several adjustments to get to this point. I was trying out with different versions of the dh-virtualenv package to avoid certain errors that only occur with some of the flags. In the end, I went back to using the deb package based on github and uninstall the pip installed version.

I first got this error:

   [...]
debian/rules clean
dh clean --with systemd,python-virtualenv
dh: unable to load addon systemd: Can't locate Debian/Debhelper/Sequence/systemd.pm in @INC (you may need to install the Debian::Debhelper::Sequence::systemd module) (@INC contains: /etc/perl /usr/local
/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at (eval 13) line 2.
BEGIN failed--compilation aborted at (eval 13) line 2.

But installing a new package fixed it:

 sudo apt-get install dh-systemd

Cheers!

@jhermann
Copy link
Contributor

If you use dh-systemd in your rules, then that must be part of your build-depends.

@benman1
Copy link
Author

benman1 commented Aug 31, 2016

I think you misread. systemd is not the problem. That was a comment on how to fix systemd issues.

Again, my problem is:

dh_strip: strip --remove-section=.comment --remove-section=.note --strip-unneeded debian/packagename/usr/share/python/packagename/lib/python3.4/site-packages/sklearn/linear_model/sgd_fast.cpython-34m.so returned exit code 1
make: *** [binary] Error 29
dpkg-buildpackage: error: debian/rules binary gave error exit status 2

@nailor
Copy link
Collaborator

nailor commented Sep 1, 2016

Hi,

sounds like you have been hit by issue #150. There are some solutions in there that might work for installing packages like sklearn.

@jhermann
Copy link
Contributor

Current thread is #203, closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants