1

I'm trying to run a flask app on my aws ec2 instance. I've installed anaconda with python 3.5.

In order to install mod-wsgi I run the following command:

sudo yum install libapache2-mod-wsgi python-pip git

The result was that a lot of python 2.6 dependencies got installed. I find this confusing as the python version that I'm running is supposed to be 3.5.

Dependency Installed:
  python26.x86_64 0:2.6.9-2.84.amzn1
  python26-backports.x86_64 0:1.0-3.14.amzn1
  python26-backports-ssl_match_hostname.noarch 0:3.4.0.2-1.12.amzn1
  python26-libs.x86_64 0:2.6.9-2.84.amzn1
  python26-setuptools.noarch 0:12.2-1.30.amzn1

You can see the output on this screenshot:

Screenshot Can you please clarify if there's something I need to do to install it for my python 3.5 (anaconda distribution) or why this is referring to python 2.6?

I'm using the following version of linux:

NAME="Amazon Linux AMI"
VERSION="2016.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2016.03"
PRETTY_NAME="Amazon Linux AMI 2016.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2016.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2016.03

thanks

3
  • Well, I'm not sure if this has anything to do with what you're experiencing, but you should avoid using Amazon Linux at all costs. If you want a RHEL-based distro, use CentOS. You'll have a much better experience in the short and long term. – EEAA Apr 19 '16 at 22:13
  • Interesting, why do you suggest to avoid that distro? Do you have any links where I can read more about the differences of the different distributions? I'm a total beginner in this. thanks – Nickpick Apr 19 '16 at 22:17
  • The problems with Amazon Linux would certainly exceed the length of this comment box. I've not bothered to write them all down; maybe I should do that somewhere. The big three problems in brief: It's actually incompatible with RHEL/CentOS, often unstable and broken, and you're locked in to Amazon's cloud. – Michael Hampton Apr 19 '16 at 22:38
0

You may have multiple versions of python installed.

The result was that a lot of python 2.6 dependencies got installed. I find this confusing as the python version that I'm running is supposed to be 3.5.

Is your ec2 instance running 2.x or 3.x as the default python bin?

When you run at the command line "python" it should return output such as the below:

$ python Python 2.7.10 (default, Jul 14 2015, 19:46:27) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin Type "help", "copyright", "credits" or "license" for more information. .>>>

If you want to set the default to 3.x, follow the answers here:

https://stackoverflow.com/questions/19256127/two-versions-of-python-on-linux-how-to-make-2-7-the-default

1
  • I installed anaconda and now when I start Python it says version 3.5. But I assume the original aws server had Python 2 installed. – Nickpick Apr 20 '16 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.