PyCharm Educational Edition 2.0 is coming soon

Today, we’re excited to let you know that PyCharm Educational Edition 2.0 is coming this September. Since the previous release we’ve improved a lot of things, implemented new functionality, added new programming courses, and fixed bugs.

PyCharmEdu20

The best things about this edition will stay unchanged – it’s still going to be a completely free and open source software, specifically designed to help beginners with little or no previous coding experience to learn programming quickly and efficiently, while using a modern professional tool.

The list of improvements can be found on the Coming in v2.0 page. They are:

  • Simplified Step-by-Step Debugger
  • Inline Debugger
  • Simplified UI
  • Scratch Files
  • Quick Package Installation
  • Integration with Stepic
  • Various course creation improvements

We encourage you to sign up for PyCharm Educational Edition 2.0 Preview and use it in the upcoming educational year.

Learn programming and educate with pleasure!
JetBrains PyCharm Team

Posted in Early Access Preview | Leave a comment

Announcing the PyCharm 4.5.4 release update

PyCharm 4.5.4 has been uploaded and is now available from the download page.

It also will be available soon as a patch update from within the IDE (from PyCharm 4.5.x only).

The Release notes lists all fixes for this update.

As a recap, this minor bug update delivers the following fixes and improvements:

  • a fix for debugging external packages while using remote interpreters (PY-11462).
  • a number of fixes for the deployment subsystem.
  • a major fix for the Django manage.py tool (PY-16434).
  • a few fixes and improvements for the integrated Python debugger.
  • a fix for running IPython Notebooks with Anaconda (PY-15938).
  • a fix in order to support the local terminal for recently released Windows 10 (IDEA-143300).
  • a number of improvements for python code insight, especially a fix for autocompletion when __init__.py contains __all__ (PY-14454).
  • a fix of PyCharm hang in case of long console output (PY-14560)
  • performance improvement for global inspections (IDEA-136646)
  • a fix for viewing images with the debugger’s evaluate window (IDEA-144036)
  • a bunch of improvements in underlying IntelliJ Platform and much more.

Download PyСharm 4.5.4 for your platform from our website and please report any problem you found in the Issue Tracker.

If you would like to discuss your experiences with PyCharm, we look forward to your feedback in comments to this post and on twitter.

Develop with Pleasure!
-PyCharm team

Posted in Release Announcements | 5 Comments

PyCharm 4.5.4 RC2 is available

Having announced the PyCharm 4.5.4 Release Candidate build a week ago, today we’ve published the PyCharm 4.5.4 RC2 build 141.2569, which is already available for download and evaluation from the EAP page.

This build introduces just a few new fixes which can be found in the release notes. They are:

  • a fix of PyCharm hang in case of long console output
  • performance improvement for global inspections
  • a fix for viewing images with the debugger’s evaluate window

Download the PyСharm 4.5.4 RC2 build for your platform from the project EAP page and please report any bugs and feature request to our Issue Tracker. It also will be available shortly as a patch update from within the IDE (from 4.5.x builds only) for those who selected the Beta Releases channel in the update settings.

Stay tuned for the PyCharm 4.5.4 release announcement, follow us on twitter, and develop with pleasure!

-PyCharm Team

Posted in Early Access Preview | 4 Comments

PyCharm 4.5.4 RC is available

Today we’ve published the PyCharm 4.5.4 Release Candidate bug-fix update.

This build brings a lot of significant fixes and improvements. The Release notes lists all fixes for this update. The most notable improvements worth mentioning are:

  • a fix for debugging external packages while using remote interpreters (PY-11462).
  • a number of fixes for the deployment subsystem.
  • a major fix for the Django manage.py tool (PY-16434).
  • a few fixes and improvements for the integrated Python debugger.
  • a fix for running IPython Notebooks with Anaconda (PY-15938).
  • a fix in order to support the local terminal for recently released Windows 10 (IDEA-143300).
  • a number of improvements for python code insight, especially a fix for autocompletion when __init__.py contains __all__ (PY-14454).
  • a bunch of improvements in underlying IntelliJ Platform and much more.

Download PyСharm 4.5.4 RC for your platform from the project EAP page and please report any bugs and feature request to our Issue Tracker. It will be available shortly as a patch update from within the IDE as well. Make sure you’ve selected the Beta Releases channel in update settings.

Develop with Pleasure!
-PyCharm team

Posted in Early Access Preview | 2 Comments

Google’s Deep Dream in PyCharm

Happy Friday everyone,

Reading the subject of this blog post I hope you’re all ready to have some fun! A month ago, Google released the code in an IPython Notebook letting everyone experiment with neural networks, image recognition algorithms and techniques as described in their Inceptionism: Going Deeper into Neural Networks article. Neural networks are known for their ability to recognize different shapes, forms, sophisticated objects, and even people’s faces. Well, Google engineers used an upside-down approach: you show different images to a pre-trained neural network and let it draw what it sees on the images, with the ultimate goal of generating new creative imagery based on artificial intelligence!

deepdream0

The example code for image generation kindly shared by Google is available as an IPython Notebook on Google’s GitHub repository. I couldn’t miss the chance to try it in PyCharm. PyCharm natively supports IPython Notebook since v4 as described in this blog post. In the latest v4.5, this support is even better and can be applied to many areas, including quantitative research as described here.

While Google’s code example relies on as few dependencies as possible, several things still need to be installed first. I won’t describe the whole process of installing all the dependencies as they slightly differ across various platforms, but I’ll show you how PyCharm helps you along the way.

First, you need to install PyCharm from the official website. Both Professional and Community editions natively support IPython Notebook. Next, you’ll need to get the deepdream code from the Google’s GitHub repository. That’s a very simple task as you can get it automatically from the PyCharm’s welcome screen:

deepdream1

You can simply enter the repo URL (https://github.com/google/deepdream) in the dialog and PyCharm will clone the project for you:

deepdream2_1

After cloning, PyCharm will offer you to open the newly imported project, so here we go:

deepdream3

Now let’s take care of the dependencies. For a clean installation, I recommend creating a fresh Python virtual environment, and this is another case where PyCharm helps us. Go to Settings (Preferences for Mac users) | Project | Project Interpreter and add a new virtual environment as shown on the screenshot:

deepdream4

You’ll get a clean Python virtual environment with only a few standard packages inside. As you can see on the next screenshot, PyCharm highlights the missing dependencies in the code:

deepdream5

Place the caret on the missing dependency, use the so-called quick-fix action with Alt+Enter, and PyCharm will offer you to install it:

deepdream6

In a similar manner, install the other dependencies mentioned in the first cell of the IPython Notebook and highlighted by PyCharm. Alternatively, you can go back to Settings | Project Interpreter and install everything using the built-in package manager:

deepdream7

Note: As an option, you can choose to install the Anaconda or Canopy packages which include the superset of the scientific stack comprising most of the mentioned libraries as recommended by Google engineers. These packages are really huge and bloat your environment, so I prefer to install only what’s needed and have a minimal virtual environment.

The most difficult part is to install the last but most important dependency—the Caffe deep learning framework, developed by the Berkeley Vision and Learning Center. The installation process deserves a post of its own as it’s long and complicated. Nor PyCharm neither any other tool can help here, as this framework isn’t available on any package repository. Anaconda and Canopy don’t have Caffe on board either. So you have to install it manually. The installation guide can be found on the BVLC official website. It’s pretty descriptive and I hope you won’t meet any problems installing Caffe along the way.

The only thing I’d like to note here is that Caffe can be installed with or without the CUDA library and driver. CUDA installation is huge and will consume a lot of time, so if you want to get quick results, install Caffe without CUDA. But if you need maximum performance and don’t want to spend extra time waiting for image generation, installing CUDA is the way to go.

Finally, when you’re done installing all the dependencies we’re ready to go and have some fun. You can start with running cells one by one inside PyCharm clicking the green “Run” button. On the first cell with Python code, PyCharm will automatically offer you to start the IPython Notebook kernel:

deepdream8

Make sure you’re following the code and substitute the required paths to Caffe models and images:

deepdream9

The standard installation of Caffe have the bvlc_googlenet model already pre-installed. You only need to specify the path to your Caffe installation. Later, you can play with other models, trained on different image sets that can be found in the BVLC official github repository.

Going cell by cell in the example IPython Notebook, you can generate images from the standard pictures that come with the example project:

deepdream10

After you’re done with the default examples, it’s time to do something really fun and weird. Experiment with your own pictures and code modifications!

I decided to find out what the neural network would see on the PyCharm logo. I added the logo to the project and changed the code:

deepdream11

And this was the output:

deepdream12

Weird and funky, isn’t it? But wait, that’s just the beginning. Let’s go further and write some custom code. When modifying the code, PyCharm helps you with autocompletion:

deepdream13

It also helps with function parameters:

deepdream14

I involved a different layer which is responsible for image actualization enhancing edges and textures, giving the image an impressionist feeling:

deepdream15

The code authors encourage readers to experiment with layer selection to see how it affects the results. There’s definitely lots of room to explore the design!

Note: You can get the list of layers by executing the net.blobs.keys() code.

The real fun starts when we start feeding a neural network its own output. This leads to very unusual and weird results. You can see true dreams of a neural network and art generated by artificial intelligence.

Executing the following code we produce a number of frames. When transformed slightly, each of them becomes an input on the next cycle of neural network dreaming:

Here is the original image:

pycharm

And here is what we can see on frame #8:

deepdream17

Is it a dog appearing out of PyCharm’s logo snake’s head?

And on frame #14 I can see a frog’s head on a bird:

deepdream18

The further you go, the more interesting results you get. Here’s frame #26:

deepdream19

In frame #49, there’s something completely bizarre:

deepdream20

This technique of applying different layers using different image sequences leads to the ultimately infinite number of results and filters we can use to produce and modify images.

The authors of this idea encourage you to play with the code, generate your own images, and post them to Google+, Facebook or Twitter. Be sure to tag them with #deepdream so other researchers can check them out too. Also, use the #pycharm hashtag if you like this post and if PyCharm helps you create your own spectacular pictures.

I hope you enjoyed this fun experiment with Google deepdreams and PyCharm.

Talk to you soon!
-Dmitry

Posted in Cool Feature | Tagged , , , | 8 Comments

Feature Spotlight: Creating and managing Django projects

Happy Friday everyone,

PyCharm is known for its superior support of the Django web framework. It’s been supported since the inception of PyCharm, and with each release we improve it by polishing the existing features and adding new ones.

With the latest PyCharm 4.5 release, we’ve improved Django 1.8 code insight and added a big new feature: the manage.py console.

This new tool introduces a new user interface and provides autocompletion for manage.py tasks and their arguments. The manage.py console also preserves the command history so you can easily fetch previous commands just by pressing Up / Down arrows. Quick documentation is also supported by pressing Ctrl+Q on a manage.py command.

Note: Django support is available only in PyCharm Professional Edition.

Given the number of big and small changes to Django support, recently we updated our main Creating and managing Django projects tutorial. Do check it out if you are migrating to PyCharm as a new development environment and want to get used to its basics. Or if you just want to revisit the whole picture of Django development with PyCharm.

Talk to you soon,
-Dmitry

Posted in Cool Feature, Tutorial | 6 Comments

Quantitative Research in Python: Using Notebooks

This is a first in a series of blog posts covering the use of Python for quantitative research. In this post, we take a look at IPython Notebooks: a really handy tool for structuring calculations in a document-like fashion.

If you look at the state of various computer algebra systems (CASs) today, you will see that they typically operate not only on the basis of a REPL-style console window input, but rather provide a workbook/worksheet/document mechanic whereas the commands to be executed and their results are mixed together. This effectively provides for literate programming and makes it easy to write entire articles/books directly from a CAS.

Mathematica Notebook

Python is no exception: it has taken the world of numerical computing by storm, becoming a serious contender to established programming languages such as MATLAB or R. And indeed, the exact mode of interaction is supported in Python too with the use of IPython Notebooks.

The IPython Notebook

First of all, make sure you’ve actually got Python and IPython. The simpliest way of doing this is to simply install a distribution package that includes lots of pre-built Python tools, such as Contunuum’s Anaconda or Enthought Canopy.

The IPython Notebook support is part of the IPython distribution. Its goal is to provide a web-based document editing experience whereas the user can enter one of two things:

  • Ordinary text (Markdown format) that will be presented as such. Among other things, IPython Notebooks support LaTeX formatting, which is great for rendering formulae.
  • Python code, which is stored in cells. You can execute each of the cells and the output will appear right after the relevant cell.

Here’s what typical interaction with a workbook looks like:

Now, you could be forgiven for thinking that this form of interaction only supports textual output. In actual fact, it supports graphical output too, so you can do data visualizations with libraries such as Matplotlib. Simply import the package and call its APIs and you’ll get the visual output right here on the page:

While the IPython notebooks are great when used on the web, they offer little help when coding. Sure, they report on the errors in your cells, but apart from non-automatic code completion, they do not offer any coding assistance features (e.g., automatic code completion, parameter info, navigation, as-you-type error checking, and so on), so you essentially need to know the API by heart and rely on the interpreter itself to catch your errors. Alternatively, you can just use PyCharm.

Notebooks in PyCharm

Using IPython notebooks in PyCharm is easy, and gives you the benefit of PyCharm’s features such as code completion. Here’s how to do it.

Note: an active IPython notebooks instance is only required for evaluation of Python code. Text rendering is handled by PyCharm itself.

First, create a file with an .ipynb extension. This signals to PyCharm that it’s an IPython notebook.

Second, makes sure an IPython Notebook kernel is running. The simplest way is to simply fire up PyCharm and when you try to evaluate something, you will see the following dialog:

z

Simply enter the URL and PyCharm will fire up an IPython notebook at this exact location.

Finally, go ahead and edit the cells in the document. Unlike the web interface, PyCharm provides a lot of things: you get code completion, inspections and navigation features that you would expect if you were working with an ordinary Python project:

Press Ctrl+Enter to execute a cell. Note that the cell number gets incremented accordingly. Press Shift+Enter to add a new cell.

If you want to add some text or a heading, use the drop-down menu to pick the appropriate element. Text entries also support LaTeX — use a single $ to delimit inline formulae and two dollars ($$) for display formulae.

Finally, it’s worth noting that PyCharm’s theming is matched in the worksheet, so if you prefer a more article-like feel, this is possible too:

Libraries for Quantitative Analysis

The simplest kinds of libraries that you need for quantitative analysis are mathematical libraries such as NumPy and SciPy. These packages contain a wealth of different numerical method implementations.

When it comes to visualization, there is the excellent matplotlib library that we already mentioned.

And of course there are plenty of wrappers around native libraries available to Python through the power of tools like SWIG. For example, the QuantLib library uses it to generate Python wrappers around its C++ interfaces. It’s not an ideal process, but it does produce a workable package that you can use.

Naturally, Python also has other bindings which might be useful when analyzing and visualizing data. These include things such as tools for building interactive applications (e.g., wxPython) or bindings to NVIDIA CUDA via PyCuda.

So, that’s it for now! Enjoy IPython notebooks!

Posted in Tutorial | Tagged , , | 6 Comments

Meet the PyCharm Team in Bilbao, Spain, at EuroPython 2015

europython-2015-logo-white-bgThe JetBrains PyCharm Team is currently in Bilbao, Spain, for EuroPython 2015 (July 20–26). The conference is held in the Euskalduna Conference Center (ECC, Abandoibarra Etorbidea 4, Bilbao).

EuroPython is the second largest global conference for the popular programming language Python, surpassed only by the PyCon US conference. It is aimed at the entire Python community, from professional programmers to those who are just starting to learn this fantastic language. This year’s event will feature more than 200 sessions, including three by JetBrains:

CAN RUST MAKE PYTHON SHINE?Monday, July 20, at 14:30
by Dmitry Trofimov

Rust is a new programming language from Mozilla. It is fast, safe and beautiful. It is also a very good option when you need performance. In this talk we’re going to look at Rust and see what it offers and how we can leverage it as Python developers. And we’ll do it with a case study: a statistical profiler for Python.

NUMPY: VECTORIZE YOUR BRAINThursday, July 23, at 12:30
by Ekaterina Tuzova

NumPy is the fundamental Python package for scientific computing. However, being efficient with NumPy might require slight changes in how you write Python code.
I’m going to show you the basic idioms essential for fast numerical computations in Python with NumPy. We’ll see why Python loops are slow and why vectorizing these operations with NumPy can often be good.
Topics covered in this talk include array creation, broadcasting, universal functions, aggregations, slicing and indexing. Even if you’re not using NumPy, you’ll benefit from this talk.

HOW YOU CAN BENEFIT FROM TYPE HINTSFriday, July 24, at 11:45
by Andrey Vlasovskikh

PEP 484 introduces type hints for Python 3. Type hints can increase the readability of our code for both humans and tools, and lead to better and safer outcomes. And we’ll prove it in this talk!
We’re going to take a closer look at type hints and see practical examples of where they can be used and what value they provide. We’ll see that simple class types and built-in collection types are often enough for our public APIs. We’ll also discuss how you can benefit from type hinting stubs for third-party libraries and briefly cover more advanced scenarios like generic types.

This show represents a great opportunity to meet PyCharm team members, learn about the latest releases, our current developments and future plans, discuss the latest trends in the Python world and related technologies… or just say ‘Hi!’. Stop by our booth in the expo hall, ask questions and share your experiences with PyCharm and other JetBrains products. We’re raffling some PyCharm licenses so be sure to register and grab some of our cool giveaways too!

We look forward to meeting you there. For more information on the EuroPython 2015 conference, please visit its official website.

Develop with pleasure!
PyCharm team

Posted in Conferences & Events | Leave a comment

Announcing the PyCharm 4.5.3 release update

The PyCharm 4.5.3 has been uploaded and is now available from the download page.

It also will be available soon as a patch update from within the IDE (from PyCharm 4.5.x only).

As a recap, this minor bug update delivers the following fixes and improvements:

  • a number of fixes for Django support, mostly related to the new manage.py tool.
  • a bunch of improvements in Python refactorings and the new auto-intention: convert tuple to list and vice-versa which is available on Alt+Enter over the cursor on a list or a tuple.
  • The new option in Python code style settings: “After local imports” on the “Blank lines” tab. Using this field, you can specify the number of blank lines to be inserted after local import inside a function. By default this value is set to 0.
  • a couple of important fixes for Python code insight.
  • a fix for spurious matplotlib messages in the console.
  • a number of fixes for the brand-new Python profiler (including support for Python 2.4 and 2.5).
  • a stunning list of fixes for the integrated Deployment tool.

For further details on the bug fixes, please consult the PyCharm 4.5.3 RC and PyCharm 4.5.3 RC2 release notes.

Download PyСharm 4.5.3 for your platform from our website and please report any problem you found in the Issue Tracker.

If you would like to discuss your experiences with PyCharm, we look forward to your feedback in comments to this post and on twitter.

Develop with Pleasure!
-PyCharm team

Posted in Release Announcements | 1 Comment

Announcing the PyCharm 4.5.3 RC2

Having announced the PyCharm 4.5.3 Release Candidate build two weeks ago, today we’ve published the PyCharm 4.5.3 RC2 build 141.1899, which is already available for download and evaluation from the EAP page.

The full list of fixes and improvements for this build can be found in the release notes. The list is really huge so here are the most notable improvements:

  • a couple of important fixes for Python code insight
  • a fix for spurious matplotlib messages in the console
  • a number of fixes for the brand-new Python profiler (including support for Python 2.4 and 2.5)
  • a stunning list of fixes for the integrated Deployment tool.

Download the PyСharm 4.5.3 RC2 build for your platform from the project EAP page and please report any bugs and feature request to our Issue Tracker. It also will be available shortly as a patch update from within the IDE (from 4.5.x builds only) for those who selected the Beta Releases channel in the update settings.

Stay tuned for a PyCharm 4.5.3 release announcement, follow us on twitter, and develop with pleasure!

-PyCharm Team

Posted in Early Access Preview | 6 Comments