Closed demining closed 1 year ago
Which version of Ubuntu do you have?
What is the result of the following command?:
apt-cache search fpylll
@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
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 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?
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
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
You are missing at least autoconf
:
sudo apt install autoconf
@cr-marcstevens I also get an error: https://pastebin.com/MpgLWS03
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 What does it mean? What should I look at and fix?
Install libtool:
sudo apt install libtool
@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?
In some shells source
is not a valid command to read a script, in those cases you case use .
instead, so:
. activate
@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
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?
Trying to install Fpylll package on Ubuntu as per the doc:
LINK
I receive a notification:
How to install on Ubuntu? How can this problem be solved?