lektor icon indicating copy to clipboard operation
lektor copied to clipboard

Installation fails on Elementary OS 5.1.7 Hera

Open jurgenizer opened this issue 5 years ago • 5 comments

Installing Lektor using $ curl -sf https://www.getlektor.com/installer.py | sudo python3 as per documentation results in an error. How can I fix this please?

Details: Python 3.6 is installed. sudo apt-get install python3-dev libssl-dev libffi-dev installed OK. sudo apt-get install imagemagickinstalled OK.

Error:

Complete output from command python setup.py egg_info:

        =============================DEBUG ASSISTANCE==========================
        If you are seeing an error here please try the following to
        successfully install cryptography:

        Upgrade to the latest pip and try again. This will fix errors for most
        users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
        =============================DEBUG ASSISTANCE==========================

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-wsfr8z04/cryptography/setup.py", line 14, in <module>
    from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wsfr8z04/cryptography/

jurgenizer avatar Mar 22 '21 14:03 jurgenizer

My guess is the cause of this is recent updates recently made in version 3.4 (of the third-party) cryptography package which incorporate some rust code.

Here are some references: Azure/azure-cli#16858, frappe/easy_install#19. They report that updating pip to the latest version and/or pinning cryptography==3.3.2 will fix the issue. I'm not very familiar with the installer.py script, and I'm not sure that either of these steps are easily doable when using it to install Lektor.

If possible, you might try installing manually using pip from a virtualenv.

# create virtualenv.  (You may substitute any sane path in place of "venv-lektor")
python3 -mvenv venv-lektor
# update pip in venv to latest version
venv-lektor/bin/pip install --upgrade pip
# install Lektor in venv
venv-lektor/bin/pip install lektor

If that works, you may then run Lektor as:

venv-lektor/bin/lektor [...]

dairiki avatar Mar 22 '21 16:03 dairiki

Hi @dairiki, thank you for your help. I tried upgrading pip and also pinning cryptography==3.3.2. Unfortunately these measures did not work in my case, so I installed Lektor manually using pip from a virtualenv as you suggested. This worked :)

jurgenizer avatar Mar 26 '21 06:03 jurgenizer

Same here, on AVL-MXE-2020.12.03 (Debian-Buster based). I solved it by adding a line in installer.py to upgrade pip before installing lektor:

def install_lektor(lib_dir):
    create_virtualenv(lib_dir)

    pip = get_pip(lib_dir)
    call([pip, "install", "--upgrade", "pip"])

oliverbienert avatar Apr 06 '21 22:04 oliverbienert

@oliverbienert thank you so much, this has been driving me crazy on Ubuntu 18.04, your solution works perfectly.

It seems that globally updating pip on the OS is not enough, or at least it, didn't work for me.

mig5 avatar Apr 14 '21 22:04 mig5

@oliverbienert I finally got round to trying your suggestion on Elementary OS 5.1.7, it works! Thank you so much! I will add your fix as a pull request on the lektor/lektor-website repo. P.S. I also asked the question on Stack Overflow. https://stackoverflow.com/questions/66731157/lektor-cms-installation-fails-on-elementary-os-5-1-7-hera. I'll leave it to you @oliverbienert to add the official answer there if you like :)

jurgenizer avatar May 29 '21 11:05 jurgenizer