Orange Forum • View topic - Cannot Import Orange

Cannot Import Orange

A place to ask questions about methods in Orange and how they are used and other general support.

Cannot Import Orange

Postby obeginner » Sat May 18, 2013 0:08

I am trying to use orange on my MacBook Air. I could import orange in Terminal and read the "lenses" file. But I can't import orange in my python script - orange not found. I ran "easy_install numpy && easy_install orange" in my terminal but permission to write into site-package is denied. I am the administrator of my MAC. Can someone please give me step-by-step procedure that allows me to import orange into the python environment? I am a beginner.

Re: Cannot Import Orange

Postby Ales » Mon May 20, 2013 13:10

obeginner wrote: I could import orange in Terminal and read the "lenses" file

Did you do this using the python bundled in the Orange.app application (considering you failed to install with easy_install)?
In that case you can use the bundled python to run your scripts. For instance
Code: Select all
/Applications/Orange.app/Contents/MacOS/python myscript.py
or extend the PATH variable
Code: Select all
export PATH=/Applications/Orange.app/Contents/MacOS/:$PATH
python myscript.py
python myscript2.py

(also see the "Scripting Using Orange from the .dmg Install" for some more tips)

obeginner wrote:I ran "easy_install numpy && easy_install orange" in my terminal but permission to write into site-package is denied
In order to compile and install orange in the system python's site-packages you have to run the easy_install commands using sudo
Code: Select all
sudo easy_install numpy
sudo easy_install orange

You will be prompted to enter your password before the commands are run.

An alternative (and better way as pip supports an uninstall command) is to use pip
Code: Select all
sudo easy_install pip
sudo pip install numpy
sudo pip install orange


you can also install into user specific site-packages (no need for sudo)
Code: Select all
pip install --user numpy
pip install --user orange


Return to Questions & Support



cron