LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-03-2019, 07:38 PM   #1
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Rep: Reputation: Disabled
Can I make virtualenv (and/or uwsgi) use python 3.6 instead of 2.7?


I'm figuring out to setup uwsgi and it's working so far but it's running 2.7.1; I want it to run 3.6 (which is already installed) instead.

When I run virtualenv to make a new environment to run uwsgi in, the default python --version is still python 2.7.15.

There's gotta be a way to change that right?

I'm in ubuntu 18.04.2 thanks.
 
Old 11-04-2019, 01:47 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Virtual environments are built into Python 3. To create a Python 3 venv, run
Code:
python3 -m venv /path/to/new/virtual/environment
 
1 members found this post helpful.
Old 11-06-2019, 08:13 PM   #3
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Yea thanks bernbausch I asked in a python forum; turns out your advice was correct.

Here's what I did:

It's kind of a hybrid of the tutorial, their advice, and your line:

Code:
sudo apt-get install python3-venv
python3 -m venv ./myapp
cd myapp
source bin/activate
And then subsequently:
Code:
uwsgi --socket 0.0.0.0:8080 --protocol=http -w wsgi
And then in the browser it was able to talk to my hello world app.

Thanks
 
  


Reply

Tags
python



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
please help me use python in virtualenv on linux mint 18 rivola Linux - Newbie 1 11-04-2016 08:18 PM
LXer: Setting up the python virtualenv development environment on Debian Linux LXer Syndicated Linux News 0 04-13-2015 12:31 AM
Geany - Activate Python Virtualenv - Bourne Shell Permissions flebber Linux - Software 2 02-03-2014 04:03 AM
New to Python, need some assistance with virtualenv. manwichmakesameal Slackware 2 06-23-2013 10:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration