lektor: Install script: can't open file virtualenv.py, no such file

System Details

macOS Sierra 10.12.6 using pyenv to build python 2.7 (workaround for macOS issue with pre-TLS OpenSSL) Python 2.7.15 OpenSSL 1.0.2p 14 Aug 2018

Error Messages

$ curl -sf https://www.getlektor.com/install.sh | sh

Welcome to Lektor

This script will install Lektor on your computer.

   Lektor seems to be installed already.
   Continuing will delete:
   /usr/local/lib/lektor
   and remove this symlink:
   /usr/local/bin/lektor

Continue? [Yn] 

Installing at:
  bin: /usr/local/bin
  app: /usr/local/lib/lektor

Continue? [Yn] 
/Users/rob/.pyenv/versions/2.7.15/bin/python: can't open file './virtualenv.py': [Errno 2] No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 148, in <module>
  File "<stdin>", line 143, in main
  File "<stdin>", line 107, in install
  File "/Users/rob/.pyenv/versions/2.7.15/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/Users/rob/.pyenv/versions/2.7.15/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Interpretation

The expected file, virtualenv.py, is in the src directory, not the root directory, in the current tar file. The current tar file in my case seems to be: https://files.pythonhosted.org/packages/4e/8b/75469c270ac544265f0020aa7c4ea925c5284b23e445cf3aa8b99f662690/virtualenv-16.1.0.tar.gz

Proposed Solution:

Update installer logic near line 124 to also look for virtualenv.py in ./src. Popen([sys.executable, './virtualenv.py', lib_dir], cwd=t).wait()

For my system, install.sh worked after changing line 124 to this: Popen([sys.executable, './src/virtualenv.py', lib_dir], cwd=t).wait()

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 11
  • Comments: 15 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @renateEta, this is probably because the installer is currently broken (see #720). You should be able to install it by downloading the suggested fixed script from https://raw.githubusercontent.com/lektor/lektor/5f2c070f6c89df5fbfb6cdf8c539207b925c59d8/bin/install.py and then run it using Python.

In a terminal you’d do:

curl -sf https://raw.githubusercontent.com/lektor/lektor/5f2c070f6c89df5fbfb6cdf8c539207b925c59d8/bin/install.py | python3

This commit is what broke this: https://github.com/pypa/virtualenv/commit/af5711ca9346b265f196a9cf266cecda9bca5b91#diff-51642b24ac9529f4baa0f483fa257d2d

First released in Virtualenv 16.1.0 on October 31 2018.

Thanks @runfalk . It works now.