question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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()

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
runfalkcommented, Mar 27, 2020

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
2reactions
lfranckecommented, Nov 7, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Virtualenv returning a 'No such file or directory...' error
I am using Ubuntu 11.10 and Python 2.7. EDIT: Figured it out. I originally installed it with pip, so I uninstalled via pip...
Read more >
Installation: activate_this.py "No such file" - Google Groups
This seems to be a command in the file virtualenv.py, but I am a little lost on how to troubleshoot this.. python: can't...
Read more >
venv — Creation of virtual environments — Python 3.11.1 ...
Running this command creates the target directory (creating any parent directories that don't exist already) and places a pyvenv.cfg file in it with...
Read more >
How To Set Up a Virtual Python Environment (Windows)
virtualenv is a tool to create isolated Python environments. ... command creates a file called requirements.txt that enumerates the installed packages.
Read more >
Installing and using virtualenv with Python 3
pip3 is not installed on the server by default. You must first install a custom version of Python 3. This custom installation of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found