25 December 2014

Exporting and importing a virtualenv

One nice thing I recently learnt about virtualenv environments is that they ease project exportation.

When you give one of your project to a friend or colaborator, inside a compressed file, you have to tell him which dependencies to install to run the project. Fortunately virtualenv (actually pip) gives you and automated way to do it.

Suppose you have a project folder you want to export and suppose you have made a virtualenv for that project. With your virtualenv activated, run:

(env)dante@Camelot:~/project-directory$ pip freeze > requirements.txt


This will create a file called requirements.txt. In that file pip will place all packages names and versions installed for that virtualenv. Generated file (in our case requirements.txt) should be included in exported file bundle.

To import a project exported that way, importer should uncompress project folder and create a virtualenv in its location. With that virtualenv activated pip should be called this way:

(env)otherguy@host:~/project-directory$ pip install -r requirements.txt


This call to pip will install all packages and versions included in requirements.txt. Easy and efficient.





16 November 2014

Visual Studio Community

Great news for developers. Following the new trends started by Satya Nadella, Microsoft announced last 12 of November that a new Visual Studio version was about to be launched with wide opened license allowing free use by individuals and small development groups for either commercial and not commercial uses.

This new version is called Visual Studio Community and arrives at update 4 for Visual Studio 2013. Unlike Visual Studio Express edition Community promises all Visual Studio features for free, specially appreciated are plugin and cross platform support. With Express edition you had no access to the over 5.000 extensions (a.k.a plugins) available for Visual Studio, Community edition changes that and will let you install all plugins you need. Besides Express edition was focused on platform specific development (Web version, PC version, etc). Community edition, following Microsoft new guidelines towards device convergence, unifies that and lets you develop targeting cross-platforms.

With those features, why download Visual Studio Express?, actually I don't know.  Some say Community version of Visual Studio will retire Express version, but Microsoft hasn't done so far.

Following its license, you can download for free Visual Studio Community for solo development, either commercial or not, or for group development under 5 individuals if you or your group are not working for an enterprise (which bassically is defined like an organization with 250 PC or 1 million dollars of yearly revenues). If you fall in enterprise category you can only use Community edition for educational and open sources purpuses.

With its tools highly integrated (designers, debuggers, editors and profilers) and its support for multiple languages like C#, Visual Basic, Visual C++, Javascript, HTML5 and (best of all) Python, Visual Studio is a great choice for developing in Windows ecosystem. I'm pretty happy with PyCharm and it's cross platform support but I guess I'll give a try to Visual Studio next time I deal with a .NET with IronPython.