4

Just starting out with AWS Cloud9. Started a new project (Django with Beanstalk).

Opened Cloud9 environment, typed in virtualenv --python=/usr/bin/python3.6 venv

then, when i type: sourse venv/bin/activate

i see: (venv) USERNAME:$

So, it looks ok, but python --version gives me 2.7.

Even more, when I install packages with "activated" virtual environment I get them installed in system-wide python 2.7.

Coykto
  • 1,014
  • 9
  • 12
  • What happens when you type "python3 --version"? Also, I'm no Python expert, but I recommend using "conda" from Miniconda as my environment and package manager. I actually had a similar question to yours, and I found my answer (maybe it helps you): https://stackoverflow.com/questions/54102477/configure-aws-cloud9-to-use-anaconda-python-environment – Sean McCarthy Jan 19 '19 at 23:18
  • I'd imagine it'd be python 3.5, since it's default for Ubuntu. The problem is, it's still system-wide python. Also, your solution is not really a solution. You just call python executable with a full path, but you still don't use virtual environment. So to install pip package you will need to use full path for your pip as well. Like: `/home/ubuntu/anaconda3/envs/ijackweb/bin/pip3.6 install -r requirements.txt` which is the same as not using virtual environment at all. – Coykto Jan 21 '19 at 04:45
  • I do have a virtual environment. It's a conda virtual environment, and when I activate it with "source activate ", either conda or pip will install packages into the environment. My question was a bit different--it was about configuring AWS Cloud9 to use the Python inside the conda environment, rather than the system-installed version of Python. – Sean McCarthy Jan 26 '19 at 18:56

0 Answers0