Thursday, August 22, 2013

Getting Kivy to run on MacOSX with PyCharm and Virtual Env

Just had a little bit of a struggle getting Kivy to run from my PyCharm IDE, this is how I solved it

My initial Python environment setup was done are follows:

I installed my Python framework via MacPorts.
For Python 3:
sudo port install py33-numpy py33-scipy py33-matplotlib py33-ipython +notebook py33-pandas py33-sympy py33-nose
For Python 2.7:
sudo port install py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose

To set your MacPort Python to the default:
For Python 3:
sudo port select --set ipython ipython33
sudo port select --set python python33
For Python 2.7:
sudo port select --set ipython ipython27
sudo port select --set python python27

Adding this to you .profile is probably a good idea when you use MacPorts:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH

This installs pretty much all the major packages (some of which I could install via PyCharm's package install interface), including cython needed by Kivy.

Then in PyCharm I created a virtual environment, and installed pip onto that. I could install Kivy directly in PyCharm, but it still requires PyGame to actually run.
PyGame I found requires X11 / XQuartz, which is no longer bundled with OSX and can be downloaded from:
http://xquartz.macosforge.org/landing/
Once that is installed.


Run the MacPort mercurial install first else you'll get "The command named 'hg' could not be found"
sudo port install mercurial
Then from the bin of my virtual env I could install pygame:
./pip-2.7 install hg+http://bitbucket.org/pygame/pygame

After that I could execute my App from the run configurations within PyCharm

9 comments:

  1. Thanks for sending this message.

    ReplyDelete
  2. Instyle jackets provide best fashion and celebrity leather jacket quality to all of the customers with the best leather jacket quality. provide not only jackets coats, vest and all the custom designs. visit to our website and get your jacket.

    ReplyDelete
  3. The Garage door companies in CT deliver best work. These companies may also offer installation of garage door openers or replacement of old garage doors with new ones.

    ReplyDelete
  4. The Mauvetree brown men leather jacket is a leading brand of sheepskin jackets and clothing. The material used for making their products comes from the best quality of real shearling sheepskin leather that are carefully selected in order to obtain a superb quality and comfort. They have been manufacturing high-quality jackets since 1958.

    ReplyDelete

  5. Are you in a hurry to get to the airport? Don't worry, we have got your back! 247 Airport Taxis offers the fastest and most reliable taxis at surprisingly low prices. We pride ourselves on offering 24/7 prompt service and our goal is 100% customer satisfaction. With Meet & Greet and pick-up & drop-off services, we can make your trip hassle free. GPS tracking and flight monitoring allow us to be ahead of any surprises that may arise during your travel. Our drivers are courteous and professional, so you can relax in confidence knowing that you will be taken care of from start to finish!
    The price for one way cab is cheaper than the normal booked car or taxi ride from 24/7 Airport Taxis

    ReplyDelete
  6. Ramma Foundation Repair is a trusted app designed to assist property owners in Foundation Repair Edmonton needs. With a focus on providing reliable and efficient solutions, the app connects users with experienced professionals who specialize in foundation repair services. Discover peace of mind and ensure the stability of your property with Ramma Foundation Repair in Edmonton.

    ReplyDelete
  7. Nida Faysal's Party Wear collection combines bold designs with rich, vibrant colors, ensuring you stand out at any celebration. Each piece offers a perfect blend of elegance and comfort, allowing you to enjoy every moment in style. Celebrate life's special occasions with these striking and sophisticated garments.

    ReplyDelete
  8. The Massage Center in Karachi dha offer a haven of relaxation, with expert therapists providing a range of soothing treatments. Perfect for unwinding and rejuvenating in a tranquil setting.

    ReplyDelete

Popular Posts

Followers