Geek Garage

Find inspiration in awesome ideas.

Tag: OS X

Setup Django on OS X

Installing Django on OS X is just as easy as any other Python library or framework. It is just a one line command as it is described in the Django documentation. But if you have an all-new OS X system, you don’t have all the tools installed. Pip is not part of the standard system, but installing also straightforward and you just have to follow the documentation. This post is a reminder for all the steps.

To download the pip-installer, the preferred way on OS X is by using curl:

curl -O https://bootstrap.pypa.io/get-pip.py

You can install pip using this installer. Be aware that you’ll need the administrator privileges.

sudo python get-pip.py

Now you can install Django as it is described in the documentation which was version 1.7.1 at the time of writing this post.

sudo pip install Django==1.7.1

You can finally check if the installation is successful in a Python console

>>> import django
>>> print(django.get_version())
1.7.1

As you see, no tricks here. All the documentations are correct so everything should be ready in less than 5 minutes. Hope that if you find this post, it will have saved you the extra minute to search trough the different docs.

Upgrading to Yosemite and Android Studio

I just upgraded to Os X Yosemite and ran into some issues to have Android Studio running properly. Some things must be checked right after the upgrade. But you will have the same issues on a new Mac while installing your development tools. So, check this out.

You must remember that Java is no more part of Os X. So every time you upgrade Os X, you have to install it again. If not, launching any JetBrains software will pop up this message.

Java not found dialog

Actually, this message is a little misleading. If you google the problem, the solution is straightforward: you’ll have to change the value of the required jdk version in a configuration file. You just have to find the file Info.plist which is located into:

/Applications/Android\ Studio.app/Contents/

Edit that file, look for the following lines:

      <key>JVMVersion</key>
      <string>1.6*</string>

And make the following change

      <key>JVMVersion</key>
      <string>1.6+</string>

So now you are supposed to launch properly Android Studio. Unfortunately, you may see the same message again… Sounds weird until you check your Java version.

java -version

And this is how I remembered that Java was removed by the system… Told you the message could be misleading. Just install a JDK and your IDE should launch properly.

This setting is not restricted to Android Studio. Actually, you should edit the Info.plist file for every one of your JetBrains software. They should be in your Applications folder. I had to update the configuration file for PyCharm, located into

/Applications/PyCharm CE.app/Contents

Unfortunately, you’ll have to get used to this. Every time I updated Android Studio, the process asked for an update of this configuration file which will roll back your modifications.

Back to Android Studio. Once I launched it, the project loaded properly, but unfortunately stopped with the following message.

Gradle can't find javaHome dialog

The trick is that the JavaVirtualMachines is no longer into this path but into /Library/Java. So you may have to correct that value either.

Now, you are good to go.

Powered by WordPress & Theme by Anders Norén