Skip to content
Fix Code Error

Use different Python version with virtualenv

March 13, 2021 by Code Error
Posted By: Anonymous

I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?

I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries?

Solution

Just use the --python (or short -p) option when creating your virtualenv instance to specify the Python executable you want to use, e.g.:

virtualenv --python=/usr/bin/python2.6 <path/to/new/virtualenv/>

N.B. For Python 3.3 or later, refer to The Aelfinn’s answer below.

Answered By: Anonymous

Related Articles

  • Form field border-radius is not working only on the…
  • Can't install via pip because of egg_info error
  • coercing to Unicode: need string or buffer, NoneType…
  • Trouble with boxes appearing/hiding based on selection
  • Generating a drop down list of timezones with PHP
  • ImportError: No module named sqlalchemy
  • How to get the PYTHONPATH in shell?
  • Postgres could not connect to server
  • Generating a PNG with matplotlib when DISPLAY is undefined
  • django import error - No module named core.management
  • How to fix symbol lookup error: undefined symbol…
  • Add to PATH from Laravel Sail Dockerfile
  • no match for ‘operator
  • Check if a file is executable
  • Why does `which` print out a script?
  • How do you list volumes in docker containers?
  • Adding Google Translate to a web site
  • no module named zlib
  • Django TemplateDoesNotExist?
  • configure: error: C compiler cannot create executables
  • How to add Typescript to a Nativescript-Vue project?
  • Change the location of the ~ directory in a Windows…
  • Docker compose fails to start a service with an…
  • import error: 'No module named' *does* exist
  • How to specify new GCC path for CMake
  • How to permanently set $PATH on Raspbian GNU/Linux 10
  • What is causing ImportError: No module named…
  • Ubuntu apt-get unable to fetch packages
  • cannot load such file -- bundler/setup (LoadError)
  • How can I find the product GUID of an installed MSI setup?
  • Cannot install packages using node package manager in Ubuntu
  • How can I successfully Build gRPC in C++?
  • How to remove MySQL completely with config and…
  • What is the difference between venv, pyvenv, pyenv,…
  • UnicodeDecodeError: 'utf8' codec can't decode bytes…
  • How to run a shell script on a Unix console or Mac terminal?
  • Is it possible to install another version of Python…
  • hide select options using only css
  • OperationalError, no such column. Django
  • AWS CLI S3 A client error (403) occurred when…
  • pip install - locale.Error: unsupported locale setting
  • setting JAVA_HOME & CLASSPATH in CentOS 6
  • Selenium using Python - Geckodriver executable needs…
  • pip install failing with: OSError: [Errno 13]…
  • debuild - Is it possible to build several debian…
  • How can I see the current value of my $PATH variable…
  • Removing all installed OpenCV libs
  • ImproperlyConfigured: You must either define the…
  • How to use MySQLdb with Python and Django in OSX 10.6?
  • What are the undocumented features and limitations…
  • How can I start PostgreSQL server on Mac OS X?
  • How do I get user IP address in django?
  • CentOS 64 bit bad ELF interpreter
  • How do I install Java on Mac OSX allowing version switching?
  • What is an application binary interface (ABI)?
  • In Jquery show selected a value from the searched…
  • Mysql command not found in OS X 10.7
  • How to mount host volumes into docker containers in…
  • Selenium using Java - The path to the driver…
  • Webpack dev server for vue-cli: Error spawn EACCES
  • Using Python 3 in virtualenv
  • Remove redundant paths from $PATH variable
  • How to use pipenv on mac?
  • Two versions of python on linux. how to make 2.7 the default
  • Start redis-server with config file
  • How to install Intellij IDEA on Ubuntu?
  • Can't install Scipy through pip
  • PHP Composer update "cannot allocate memory" error…
  • django.core.exceptions.ImproperlyConfigured: Error…
  • Pip3 is unable to install requirements.txt during…
  • Failed to find 'ANDROID_HOME' environment variable
  • Compiling Java 7 code via Maven
  • Command not found when using sudo
  • Don't want that Postfix+Dovecot reject "recipient…
  • Python pip install module is not found. How to link…
  • Unable to locate an executable at…
  • Completely uninstall PostgreSQL 9.0.4 from Mac OSX Lion?
  • npm global path prefix
  • What version of Python is on my Mac?
  • Homebrew refusing to link OpenSSL
  • How to prevent scrolling the whole page?
  • How to show multiple select options when user select…
  • Running a Python script from PHP
  • I do not use TBB, but I get linker errors related to TBB
  • Can't import Numpy in Python
  • Should I put #! (shebang) in Python scripts, and…
  • What is the difference between "#!/usr/bin/env bash"…
  • I was expecting segmentation fault or some kind of…
  • Install pip in docker
  • How to uninstall Ruby from /usr/local?
  • How do I resolve `The following packages have unmet…
  • php display array results by first letter from select option
  • Design DFA accepting binary strings divisible by a…
  • Npm run serve Error
  • Cannot install package scikit-learn in Pycharm and…
  • Debugging the error "gcc: error:…
  • Saving data to a file in C#
  • Using Mysql in the command line in osx - command not found?
  • Pandas how to split vlaues of every column based on colon
  • ComboBox.SelectedItem giving Null value

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

How do I remove a submodule?

Next Post:

Is it possible to break a long line to multiple lines in Python?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error