Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 14005  / 1 Year ago, sat, april 1, 2023, 1:45:49

I want to run an application that uses python2.7 version, but by default python2.7 is not installed. When I tried to use:


$ virtualenv -p python2 flaskold

It returned:


RuntimeError: failed to find interpreter for Builtin discover of python_spec='python2'

How could I create python2.7 virtual environment on Ubuntu 20.04 which goes without python 2.7 support?


More From » 20.04

 Answers
5

Install python2:


sudo apt install python2 virtualenv

Universe repository is being used for this. You could add it if not added the next way: $ sudo add-apt-repository universe.


Create virtual environment using python2.7 the next way:


$ virtualenv --python=$(which python2) /path/to/newenv/folder/

$(which python2) will return path to python2 which would be correct argument. python2 could be used to start interpreter in terminal, but could not be used as an argument value for --python directive


[#2301] Monday, April 3, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
inglehare

Total Points: 330
Total Questions: 111
Total Answers: 95

Location: Sint Maarten
Member since Tue, Mar 29, 2022
2 Years ago
;