Adding my own library to Python 3

Posted on
Sat May 28, 2022 10:17 am
dstrickler offline
User avatar
Posts: 340
Joined: Oct 08, 2010
Location: Boston, MA

Adding my own library to Python 3

In Python 2.7 in Indigo 2021, I made a Python library and put it in
Code: Select all
/Library/Python/2.7/site-packages/dws.py

With Indigo I would write a Python script and say
Code: Select all
import dws

... and then the functions in dws.py would be available to the script. I was writing.

With Python 3 (after installing Indigo 2022.1.1) it can't find the dws.py script, I'm sure because of the "Python/2.7" notion in the path.

Does anyone know what directory I should copy my dws.py script into so that the "import dws" command will work in Indigo 2022.1.1?

TIA

Dave

Posted on
Sat May 28, 2022 10:29 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Adding my own library to Python 3

dstrickler wrote:
In Python 2.7 in Indigo 2021, I made a Python library and put it in
Code: Select all
/Library/Python/2.7/site-packages/dws.py

With Indigo I would write a Python script and say
Code: Select all
import dws

... and then the functions in dws.py would be available to the script. I was writing.

With Python 3 (after installing Indigo 2022.1.1) it can't find the dws.py script, I'm sure because of the "Python/2.7" notion in the path.

Does anyone know what directory I should copy my dws.py script into so that the "import dws" command will work in Indigo 2022.1.1?

TIA


I think this Wiki entry will give you what you're looking for.

Posted on
Sat May 28, 2022 11:10 am
dstrickler offline
User avatar
Posts: 340
Joined: Oct 08, 2010
Location: Boston, MA

Re: Adding my own library to Python 3

Thanks Ryan - just what I was looking for. Works like a champ.

Dave

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests

cron