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!
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
Lance McCormick7,553 Points
Setting up a Local Python (3.4.3) Environment on Linux (Mint 17.3) Guide? Please help.
Can we post a guide to setting up a Local Python Environment using virtualenv for Linux (I am using Mint 17.3 Cinnamon 64-bit).This is where I do all my coding and I don' see why Linux would be left out of the discussion.
I have done a lot of googling and I cannot for the life of me find a proper setup guide. Linux Mint comes with Python 3.4.3, pip3 is installed, I installed virtualenv using pip3. Next, I made a empty project folder, set my directory to that new project folder, and attempted to create a new virtual environment.
I entered the command [$ virtualenv mynewvirtenv ] But it doesn't work. I get a message back from the terminal saying [ bash: /usr/bin/virtualenv: No such file or directory ]
Anyone have a solid guide that I can follow step by step? Please, if you can, cover each step I will need to take in moderate detail.
Lance McCormick7,553 Points
Thank you so much Pepe! It took me a few hours but after I got all the right things installed. The documentation helped a lot to see what I should be looking for from certain sources of information. I found an extremely helpful Youtube video that went over the setup process and commands. I finally have a virtual environment up and running (with a project folder for my code.)
The most difficult thing for me was the .bashrc file I had to create since Linux Mint does not have one by default in the Home directory and I am still a Linux newbie coming from Windows. Then I had to figure out how to tell it to use python3 in that .bashrc file. And then set the paths up for the virtual environments location and project location (The DOCS helped me a ton)
Then learning what is and how to "source" a file (my basic understanding is that it reads and executes a file) This .bashrc script file basically configured virtualenvwrapper and created some files for me automatically. So the learning curve here was just to understand what these commands were doing in this script file.
One thing I noticed was that when I create a new virtual environment, it places Python 3 AND Python (2) in there as well. I wonder why this is? Backwards compatibility? I am not sure.
I also managed to install Django using pip3 in one of my virtual environments isolated from the others. Which is the whole point of virtual environments obviously. (To isolate dependencies on a per project basis)
My only question is. HOW do I install a new version of Python 3 in its own environment??? When I create a new env it automatically creates it for Python 3.4.3
Do I create a new env, download and install a desired version of Python? If I am in my newly created env will it only upgrade my env? OR do I run a python upgrade terminal command of some type while in my new env? Its still a bit confusing? If any of you have some answers that would be much appreciated. Thanks!