fpylll icon indicating copy to clipboard operation
fpylll copied to clipboard

E: Unable to locate package python3-fpylll

Open demining opened this issue 4 years ago • 14 comments

Trying to install Fpylll package on Ubuntu as per the doc:

LINK

Update the package index:

# sudo apt-get update

Install python3-fpylll deb package:

# sudo apt-get install python3-fpylll

I receive a notification:

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package python3-fpylll

How to install on Ubuntu? How can this problem be solved?

demining avatar Sep 15 '21 14:09 demining

Which version of Ubuntu do you have?

What is the result of the following command?: apt-cache search fpylll

cr-marcstevens avatar Sep 15 '21 14:09 cr-marcstevens

@cr-marcstevens

Description:    Ubuntu 18.04.5 LTS
Codename:   bionic

With the command: apt-cache search fpylll

python-fpylll - Python wrapper for LLL-reduction of Euclidean lattices -- Python
python-fpylll-doc - Python wrapper for LLL-reduction of Euclidean lattices -- doc

demining avatar Sep 15 '21 14:09 demining

The supplied doc link is for Ubuntu 21.04 and is based on python3. For Ubuntu 18.04 the corresponding link is https://ubuntu.pkgs.org/18.04/ubuntu-universe-amd64/python-fpylll_0.3.0+ds-3build1_amd64.deb.html.

Simply use sudo apt-get install python-fpylll instead, which seems to be based on python2.7.

cr-marcstevens avatar Sep 15 '21 14:09 cr-marcstevens

@cr-marcstevens Do I really need everything to work in python3? Please help me install fpylll for Ubuntu version 18.04? I need to run a program that only works in python3 and I really need to install fpylll. How can this problem be solved?

demining avatar Sep 15 '21 16:09 demining

You don't need python3 for fpylll, python2 is fine. So it's fine to install fpylll using sudo apt-get install python-fpylll.

However if you need to use python3 for some other application and the python3-fpylll package is not available then you can still manually build and install fpylll for python3 locally by hand by reading the instructions: https://github.com/fplll/fpylll/blob/master/README.rst

You should change one thing though: instead of ./bootstrap.sh you should use PYTHON=python3 ./bootstrap.sh.

cr-marcstevens avatar Sep 15 '21 17:09 cr-marcstevens

@cr-marcstevens
I did as you said, cloned the Fpylll repositories, then ran the command: PYTHON = python3 ./bootstrap.sh and got an error. I posted a very long error record in the document at the link: https://pastebin.com/gncdfP8M

demining avatar Sep 15 '21 17:09 demining

You are missing at least autoconf:

sudo apt install autoconf

cr-marcstevens avatar Sep 15 '21 18:09 cr-marcstevens

@cr-marcstevens I also get an error: https://pastebin.com/MpgLWS03

demining avatar Sep 15 '21 18:09 demining

The hint is in the error log:

ERROR: Unable to locate GNU Libtool.
ERROR:  To prepare the fplll build system from scratch,
        at least version 1.4.2 of GNU 

cr-marcstevens avatar Sep 15 '21 18:09 cr-marcstevens

@cr-marcstevens What does it mean? What should I look at and fix?

demining avatar Sep 15 '21 18:09 demining

Install libtool:

sudo apt install libtool

cr-marcstevens avatar Sep 15 '21 18:09 cr-marcstevens

@cr-marcstevens I followed all the necessary commands that you described. After I ran the command: PYTHON = python3 ./bootstrap.sh

I get a notification

Installed /content/fpylll/fpylll-env/lib/python3.7/site-packages/fpylll-0.5.6-py3.7-linux-x86_64.egg
Processing dependencies for fpylll==0.5.6
Finished processing dependencies for fpylll==0.5.6
Don't forget to activate environment each time:

Now I execute the command as described in README.rst

source ./activate

I get a notification:

/bin/sh: 1: source: not found

What should I do next?

demining avatar Sep 15 '21 19:09 demining

In some shells source is not a valid command to read a script, in those cases you case use . instead, so: . activate

cr-marcstevens avatar Sep 16 '21 07:09 cr-marcstevens

@cr-marcstevens

I executed on command:

chmod + x activate
./activate

When I run my script, I get the error:

python3 script.py
Traceback (most recent call last):
  File "script.py", line 35, in <module>
    from fpylll import LLL, BKZ, IntegerMatrix
ImportError: cannot import name 'LLL' from 'fpylll' (unknown location)

I raised the question earlier on askubuntu

https://askubuntu.com/questions/1363992/bin-sh-1-source-not-found/1363998?noredirect=1#comment2340523_1363998

I quote

I was answered by jpbrain

Activate only sets enviroment variables to point to the Libs and bootstrap.sh is a shell script. Take a look at https://github.com/fplll/fpylll/blob/master/bootstrap.sh on lines 33-39 and 50-55. Those lines set enviroment variables. - So you need to set your enviroment correctly to be able to run it. what do you get with "env" and "env python"

What should I change in bootstrap.sh to set up the environment correctly?

demining avatar Sep 16 '21 09:09 demining