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

fpm 1.12.0, Debian 11: python to deb: easy_install executable not available, but required. #1780

Open
amdei opened this issue Apr 13, 2021 · 5 comments · May be fixed by #1982
Open

fpm 1.12.0, Debian 11: python to deb: easy_install executable not available, but required. #1780

amdei opened this issue Apr 13, 2021 · 5 comments · May be fixed by #1982

Comments

@amdei
Copy link

amdei commented Apr 13, 2021

Environment:

# uname -a
Linux ng-pideb11 5.10.0-5-arm64 #1 SMP Debian 5.10.24-1 (2021-03-19) aarch64 GNU/Linux
# fpm --version
1.12.0
# pip show setuptools
Name: setuptools
Version: 56.0.0
# pip --version
pip 21.0.1 from /usr/local/lib/python3.9/dist-packages/pip (python 3.9)
# python3 --version
Python 3.9.2

Issue:

# fpm --verbose -s python -t deb --python-package-name-prefix python3 --python-bin=python3 argparse
Setting workdir {:workdir=>"/tmp", :level=>:info}
Trying to download {:package=>"argparse", :level=>:info}
Need executable 'easy_install' to convert python to deb {:level=>:error}

As stated on https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html , easy_install is deprecated. And removed from setuptools.
After some googling I wasn't able to get it from anywhere on Debian 11.

Are there any ways to overcome this issue?
I.e. is there a way to use fpm to convert python packages to anything (.deb preferably)?

@amdei
Copy link
Author

amdei commented Apr 14, 2021

Workaround: downgrade version of setuptools:

pip install -U setuptools==50

@amdei amdei changed the title fpm 1.12.0 Debian 11 ARM64: python to deb: easy_install executable not available, but required. fpm 1.12.0, Debian 11: python to deb: easy_install executable not available, but required. Apr 20, 2021
@amdei
Copy link
Author

amdei commented Apr 20, 2021

Not until I read the code I have realised that there is a special option to prefer pip usage to easy_install.
But it doesn't work in my case (arm64 and amd64, Debian 11):

# fpm -s python -t deb --python-pip=pip3 --python-package-name-prefix python3  --python-bin=python3 argparse
Traceback (most recent call last):
        10: from /usr/local/bin/fpm:23:in `<main>'
         9: from /usr/local/bin/fpm:23:in `load'
         8: from /var/lib/gems/2.7.0/gems/fpm-1.12.0/bin/fpm:7:in `<top (required)>'
         7: from /var/lib/gems/2.7.0/gems/clamp-1.0.1/lib/clamp/command.rb:133:in `run'
         6: from /var/lib/gems/2.7.0/gems/fpm-1.12.0/lib/fpm/command.rb:574:in `run'
         5: from /var/lib/gems/2.7.0/gems/clamp-1.0.1/lib/clamp/command.rb:68:in `run'
         4: from /var/lib/gems/2.7.0/gems/fpm-1.12.0/lib/fpm/command.rb:351:in `execute'
         3: from /var/lib/gems/2.7.0/gems/fpm-1.12.0/lib/fpm/command.rb:351:in `each'
         2: from /var/lib/gems/2.7.0/gems/fpm-1.12.0/lib/fpm/command.rb:352:in `block in execute'
         1: from /var/lib/gems/2.7.0/gems/fpm-1.12.0/lib/fpm/package/python.rb:94:in `input'
/var/lib/gems/2.7.0/gems/fpm-1.12.0/lib/fpm/package/python.rb:173:in `download_if_necessary': Unexpected directory layout after easy_install. Maybe file a bug? The directory is /tmp/package-python-build-e6adfae863bf3f918c0e717fd7a3565fcec2bdeb6f5c153421fa1c83931f (RuntimeError)

The possible answer to described issue is that --build pip option does noting at the moment:
Setting workdir {:workdir=>"/tmp", :level=>:info} Trying to download {:package=>"argparse", :level=>:info} DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated and has no effect anymore. pip 21.1 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333. {:level=>:info}

@Qwarctick
Copy link

Got the same error on fedora. Use pip instead of easy_install does not work

@devicenull
Copy link

I'm still hitting this with 1.14.0

/var/lib/gems/2.7.0/gems/fpm-1.14.0/lib/fpm/package/python.rb:184:in `download_if_necessary': Unexpected directory layout after easy_install. Maybe file a bug? The directory is /tmp/package-python-build-01ff3d8441ce25a0d8b226836447620cfe418d29ff388c5eca266e90ed25 (RuntimeError)
	from /var/lib/gems/2.7.0/gems/fpm-1.14.0/lib/fpm/package/python.rb:98:in `input'
	from /var/lib/gems/2.7.0/gems/fpm-1.14.0/lib/fpm/command.rb:352:in `block in execute'
	from /var/lib/gems/2.7.0/gems/fpm-1.14.0/lib/fpm/command.rb:351:in `each'
	from /var/lib/gems/2.7.0/gems/fpm-1.14.0/lib/fpm/command.rb:351:in `execute'
	from /var/lib/gems/2.7.0/gems/clamp-1.0.1/lib/clamp/command.rb:68:in `run'
	from /var/lib/gems/2.7.0/gems/fpm-1.14.0/lib/fpm/command.rb:574:in `run'
	from /var/lib/gems/2.7.0/gems/clamp-1.0.1/lib/clamp/command.rb:133:in `run'
	from /var/lib/gems/2.7.0/gems/fpm-1.14.0/bin/fpm:7:in `<top (required)>'
	from /usr/local/bin/fpm:23:in `load'
	from /usr/local/bin/fpm:23:in `<main>'

Using

fpm --python-bin python3 --python-package-name-prefix python3 -s python -t deb --python-disable-dependency py-radix --iteration $CI_PIPELINE_ID aggregate6

@jordansissel
Copy link
Owner

As of fpm 1.14.0, fpm will automatically use pip by default, which I hope helps with some of these issues. The use of --python-pip=pip3 isn't needed anymore, unless special circumstances, since fpm 1.14.0 will now attempt to use python -m pip to fetch Python packages; the path to python itself is still controlled by --python-bin flag, so --python-bin python3 will tell fpm to invoke python3 -m pip ... to download packages.

Regarding the "unexpected directory layout" issue, I think that's a separate issue. I've opened a new issue summarizing what I think has been reported so far in this new issue: #1860

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

Successfully merging a pull request may close this issue.

4 participants