Python Library Installation

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
lightpath
Posts: 4
Joined: Thu Dec 21, 2017 3:47 am

Python Library Installation

Post by lightpath » Fri Mar 23, 2018 2:30 am

Hey there fellow scripters-

I'm working on an all-sky camera script and I was wondering if there's a way to install 3'rd party libs into IronPython. In particular I was looking at Astral, so I could know when the sun is up, and disable dark frames for example.

Does anyone know a better way to do this within the tools that ship with Ironpython in Sharpcap?

Thanks very much for putting IronPython into SharpCap by the way- It's wonderful!

Mark.

User avatar
admin
Site Admin
Posts: 1887
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Python Library Installation

Post by admin » Fri Mar 23, 2018 6:58 am

Hi Mark,

glad you like the IronPython scripting :)

I think it should be fairly simple - just use sys.path.append('c:\my library') to make IronPython search for imports in an additional folder (see https://stackoverflow.com/questions/314 ... her-source).

Iron Python can only load external modules that are pure python (not ones that have C/C++ components), so you have to be careful of that. I expect that if you set up a separate install of python 2.7 and 'pip install' the modules you want into that, you may just be able to point SharpCap at it's module directory.

cheers,

Robin

lightpath
Posts: 4
Joined: Thu Dec 21, 2017 3:47 am

Re: Python Library Installation

Post by lightpath » Sat Mar 24, 2018 9:45 pm

Those are neat solutions, I'll give them a try! Thanks Robin!

Mark.

lightpath
Posts: 4
Joined: Thu Dec 21, 2017 3:47 am

Re: Python Library Installation

Post by lightpath » Sun Mar 25, 2018 4:07 am

Unfortunately the dependencies got irritating for Astral. I'm going to try and solve this problem another way. Your solution did work, however, thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest