0

I am trying to create an python app with Heroku and VirtualEnv. I created the folder structure. and I have these files:

requirements.txt

j-database-url==0.4.0
Django==1.9.2
gunicorn==19.4.5
psycopg2==2.6.1
whitenoise==2.0.6

runtime.txt

python-3.5.1

I Have both python 2.7 and 3.5 installed on my dev machine (OS X). python runs /usr/bin/python and python3 runs /usr/local/bin/python3.

I then set up virtualenv on my folder.

$ virtualenv venv
$ pip3 install -r requirements.txt

Two problems:

  1. The python copied to my venv/bin/python is 2.7 and not 3.5. How do I force virtualenv to copy over python 3.5?
  2. python from command line still points to the python 2.7 - Why isn't this changing?

Thanks.

JasonGenX
  • 4,952
  • 27
  • 106
  • 198

1 Answers1

1

That's because the default virtualenv installed is the python 2 one. Try creating the VirtualEnv with:

$ pyhton3 -m venv virtaulenv_name

then activate your virtaulEnv with:

$ source virtualenv_name/bin/activate

This should fix the problem.

Carlos Afonso
  • 1,927
  • 1
  • 12
  • 22