Quick guide to virtualenv and virtualenvwrapper

Most libraries get updates on a daily basis. As they grow it becomes harder for software developers to catch up with the new documentation and a really small and diminutive change can make your apps obsolete.

You like your apps the way they are, you don´t want to change them but with or without you the software world progresses and you will have to update or get behind.

Maybe you need to work in two projects at the same time and one uses outdated technology. Does it mean that you will have to update and downgrade the libraries every time you want to test something? Well, yes and no. You can do it, but you don’t have to if you use a virtual environment.

virtualenv is the right tool for you. It solves the “Project B depends on version 2.x but, Project C needs 11.2x” dilemma, and keeps your global site-packages directory clean and manageable by creating isolated Python environments.  Each one with its own installation directories and doesn´t share libraries with the other environments you set. So you can have as many as you want, or as many as your hard drive allows you to.

To install you just need to run in your terminal:

sudo pip install virtualenv

 

To set it up you will basically use one main command that creates a directory with all the tools you’ll need.

virtualenv ENV

 

It includes inside an activation script so that you can change your $PATH to the bin/ directory.

source bin/activate

 

Every command or script you run from now on will be acting for that specific env or if you prefer you can run your scripts without using active if you call them from inside your bin/ directory.

If you want to exit the virtualenv just deactivate it with:

deactivate

 

Also if you want other people to run your specific app you can list all the packages you are using in your virtualenv with:

pip freeze > requirements.txt

And install them with:

pip install -r requirements.txt

If you are not very convinced about virtualenv you can use it with virtualenvwrapper, an extension that makes it much more easier and organized. It also places all your virtual environments in one place.

To install just:

pip install virtualenvwrapper

export WORKON_HOME=~/Envs

source /usr/local/bin/virtualenvwrapper.sh

You can now create virtual environments with:

mkvirtualenv venv

Work on a virtual environments with:

workon venv

Deactivate with deactivate as well but you can now delete with:

rmvirtualenv venv

Other useful commands

lsvirtualenv

List all of the environments.

cdvirtualenv

Navigate into the directory of the currently activated virtual environment, so you can browse its site-packages, for example.

cdsitepackages

Like the above, but directly into site-packages directory.

lssitepackages

Shows contents of site-packages directory.

 

References:

Seguir leyendo

My opinion about Apple Watch

Most people have criticized the second generation of Apple’s WatchOS as little innovative, but the truth is that this new generation comes with modern features that the first didn’t presented.

From little details to big software implementations as it is worth the mention of the new Time Travel app, feature that allows users to go back and forward in time for matters of simulations. The new generation of watches has implemented a lot of updates such as personalized achievements, new watch faces, a time-lapse mode that allows you to select up to five images of your choice and much more. Upgrades can be seen in the maps and music applications, the new night mode can turn your watch into an alarm clock, facetime implementation is ready, the ability to reply mails directly from the watch becomes available and the most important change is that now native applications are coming. 

However, most of this features are little appealing to the general public, prices of the clock are similar to those of a phone. Even while the demand of Apple Watches in the USA have increased a 60% percent by March it seems simple way too much for just a digital flat screen with less features than other mobile devices. If Apple really wants to reach a big market with their watch they should try changing the design, which is really poor in comparison of a real clock and lowering the prices. 

My first internship as a Django Developer @Attify Inc.

descarga

I was born in 1999, the same year that google was patented. I’m not going to lie by telling that since the first time I used a computer for googling something I questioned the processes involved, nor I thought I eventually care about that. I think a normal person don’t asks himself how does Google’s backend handle it’s search algorithm or the functionality of page indexing, actually I don’t even remember presenting any interest for computers at all the first time I used one. However I did enjoyed playing video games frequently and asked questions such as if I could cheat on Super Mario Bros for getting extra lives?  As my gaming collection grew, so did my curiosity.

 

Cheating on games led me into hacking games, which eventually led me into building games when I was fourteen. Since the moment I learned the real power of computers and what simple men can do with it, I’ve been engaged to know everyday a byte more. Information is everything and if you can bypass the established parameters so far, you can crack anything you want. You will soon start watching computers, routers, mobile devices and even websites as open opportunities for testing what you know about them. This month for my surprise I had been selected from a long range of applicants to work as an intern at one of India’s most promising startups in my opinion, Attify. An award-winning security firm who specializes in the penetration testing of the everyday holes inside the virtual realm.

 

Books and courses can teach you about the time complexity of every single algorithm known for mankind, but they don’t teach you anything about work experience.  This is something completely different. Making a vision convert from an idea to reality is something that just real entrepreneurs can achieve, luckily for me I’m proud to say that I was part of this process at Attify. We work with a whole new project. I helped connecting several social apps such as Facebook, Linkedin, Twitter and Google+ with Django Allauth as well as setting up the email notifications, integrating paypal checkout and some of the Slack API. It was exciting for me to learn how big products are made, team communication while working on different time-zones was an obstacle that taught me discipline (India’s GMT is around 10 hours ahead Venezuela’s clock) so I had to wake up a bit earlier to notify my supervisor about my daily progress. The overall experience was simply fantastic. Today I’m excited to officially say that my first job as a backend developer have finished, I’m really young and feel this company just opened my career in ways too broad to explain with simple words and to conclude, I hope Attify to grow as much as I grew with them.