Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Virtualenv

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,735 Points

Error trying to set up virtual environment

Following along with this video and I'm getting an error. I tried both python and python3. I think I must have changed some configurations on my machine at some point I'm not sure what is causing this.

venv_experiment: python -m venv ve
Error: Command '['/Users/brendan.whiting/Documents/venv_experiment/ve/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
venv_experiment: python3 -m venv ve
Error: Command '['/Users/brendan.whiting/Documents/venv_experiment/ve/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1

1 Answer

Alex Peck
Alex Peck
6,907 Points

Hi Brendan,

This is a digression, but after a bit of frustration myself with venv, I found that using the virtualenvwrapper is a much nicer way to deal with virtual environments.

I strongly recommend you take a look at this tool: http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/#virtualenvwrapper

I use virtualenvwrapper every day as part of my dev flow. Hope it helps you too.