New to Python - Found this was a good starting point

Posted on
Wed Nov 01, 2017 10:46 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

New to Python - Found this was a good starting point


Posted on
Wed Nov 01, 2017 12:42 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New to Python - Found this was a good starting point

Oh god no, don't do what that article says unless you want to break your Indigo install. :(

There's absolutely no need to use a non-Apple Python install for Indigo.

The rest of it is probably OK, but please don't do that step 1.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Nov 01, 2017 12:43 pm
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New to Python - Found this was a good starting point

Thanks for sharing that. I would urge caution on at least two fronts with respect to the steps the article outlines:

  1. I would recommend against installing additional versions of Python on your Mac -- especially if it's the one that runs Indigo. (Matt and Jay also recommend against folks installing additional Python versions.)
  2. I would also urge caution using Homebrew. It's a useful tool for sure and I believe that some libraries are only available as brew installs. However, in my experience Homebrew (and MacPorts) can add overhead to a Python install that can cause confusion at minimum and sometimes worse. Things that I've installed with pip have not once created a problem that I can recall.

YMMV, for sure. But moreover, come on in! The water's great.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Nov 01, 2017 3:41 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: New to Python - Found this was a good starting point


Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Nov 02, 2017 10:02 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: New to Python - Found this was a good starting point

Well that's me cooked then :-(

I am trying to get my head into Python.

I am trying to get automate getting Loop energy data into Indigo.

I (well Autolog found it for me) a Python script that does it.

I was trying to get a fairly standardised environment where I could follow standard Python tutorials.

But, it appears that may well have screwed up Indigo.

But there appears to be a chicken/egg problem here.

The basic beginner tutorials don't mention anything about Indigo so you need a standard beginners environment which apparently breaks Indigo.

So you really need another computer to run it on....

Anyway I'll give up on getting into Python as it seems that is a closed club.

Can anyone advise me on how to undo the install of the 'standard' environment to ensure Indigo environment is preserved please.

In frustration ......

Posted on
Thu Nov 02, 2017 10:03 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New to Python - Found this was a good starting point

Busta999 wrote:
The basic beginner tutorials don't mention anything about Indigo so you need a standard beginners environment which apparently breaks Indigo.


Mac OS comes with a standard Python environment. Nothing else is needed.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Nov 02, 2017 10:14 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: New to Python - Found this was a good starting point

mmmmmmm

I am using the Python that is on MacOS, I've not changed that or installed any other Python

The loop script has a dependency on "socketIO-client" so it seemed from the article that you needed home-brew/pip

I can remove Xcode ok, any advice on removing home-brew/ pip.

thanks

Posted on
Thu Nov 02, 2017 10:17 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: New to Python - Found this was a good starting point

No need to remove Xcode. It's a standard Apple product and doesn't interfere with anything.

To remove homebrew: https://docs.brew.sh/FAQ.html

The standard Apple install doesn't include pip, but you can install it without all the other stuff easily: "sudo easy_install pip"

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Nov 02, 2017 10:19 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New to Python - Found this was a good starting point

Completely understand your frustration, but I would urge you to not give up hope. I think what you are looking for is a way to develop your own programs and test them without having to mess up your Indigo install (more on that in a moment). When I first came to over to Indigo, I didn't know that Python even existed. I have no formal training in programming and learned everything I know on the fly. I had a ton of help from folks here, Stack Overflow, watching online tutorials and plain old 'just figuring it out'.

First off, you should get any new Python instances uninstalled. There should be plenty of guidance online to do that. Make sure to pay attention to how to fix the PYTHONPATH environment variable to make sure that the things you do are visible to Indigo. I'm sure that there are folks here that can help walk you through the steps.

As has been said, your Mac has plenty of Python installed from the factory. For our purposes, that should be more than enough. In fact, I've seen some say that it's better to not even mess with Python 3 unless you really know what you're doing because Python 3 isn't compatible with Python 2.

Lastly, you want a development tool. You can write Python scripts in any plain text editor, but there are better options. I learned on one called BBEdit (you'll see references to TextWrangler which is the little brother to BBEdit--but TextWrangler doesn't exist anymore. You can use BBEdit in 'free' mode just fine.) Once you get your feet under you, you can move on to a more complex tool. I prefer PyCharm, but there are others to choose from.

Please don't give up. Once you start to get the hang of Python, you'll be amazed at just of open and flexible Indigo can be.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Nov 02, 2017 10:42 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: New to Python - Found this was a good starting point

@DaveL17 - thanks much appreciated

@FlyingDriver HomeBrew uninstalled

I'll keep Textwrangler that I got from the App store yesterday - it looks pretty useful and if get through the entry barrier I'll definitely look at BBEdit - it comes highly recommended.

I have learnt a massive amount over two days, the guys here have been very helpful indeed.

Posted on
Thu Nov 02, 2017 11:15 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New to Python - Found this was a good starting point

Keep at it.

Regarding BBEdit/Textwrangler - you can go ahead and move to BBEdit at any time. AFAIK, Barebones isn't updating TextWrangler anymore (I'm surprised it's still in the App Store) and the free BBEdit version is the full BBEdit for 30 days and then it effectively turns into TextWrangler. In fact, I use PyCharm and BBEdit pretty much daily. I do my main development in PyCharm and use BBEdit to quickly whip up and test blocks of code and then, when I'm happy with them, move them to PyCharm. I also use BBEdit exclusively for viewing logs and other plain text files. There are some features that are hugely helpful--like being able to search text with a Grep expression.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Nov 02, 2017 2:42 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: New to Python - Found this was a good starting point

Bare Bones announced that they were EOLing TextWrangler in favor of BBEdit 12's "free" mode (which is basically what TextWrangler was before it was separate: BBEdit Lite).

pip is the canonical source for Python modules. If a library/package only distributed elsewhere (like homebrew) then, well, I wouldn't trust them. Most Python packages are hosted on GitHub but releases are still available via the Python Package Index. As FlyingDiver says, pip is easy to install (unclear why Apple refuses to install it by default, but that's a different story). In a terminal window:

sudo easy_install pip


Then anything you find in the Python Package index is easily installed with pip.

And Python is anything but a closed club - it's the world's most used scripting language and is always in the top 5 programming languages in terms of worldwide usage. It's quite open.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 14 guests