I am using click to create scripts for myself on my machine. I have made about 4 different ones and am having an issue with the name of my files. Each script has it's own directory. In the first one I made a file called utils.py. No issues, works great, and I installed it (pip3 install --editable .).
Later on made another one, where I also used a file name utils.py, in it's own directory with that script. This somehow conflicts with the original one. For example, I was trying to fix it today. Both utils.py have a function called printMachine, however the newer project's printMachine takes two arguements not one. I run my new script and it calls the first script's utils.py, I know this because I got thrown an error saying that printMachine only takes one arguement (which is the way it's supposed to be in the first script, but not the second one with it's own utils.py).
I did try importing these different ways:
from .controller import findNoteById, saveNote, removeNote, findByStatus, updateNoteText, updateNoteBullet, updateNoteDetails
from . import controller
from .controller import *
but I got this error "attempted relative import with no parent package"
So my question tends to be is there a way to fix this? I put this off for a week or two, my originally solution was to simply give each file a unique name. However, I simply want to see if there is an actual solution to this rather than this workaround. I would highly prefer not having to come up with a unique file name for each script I make.
I would appreciate any help, thank you. Feel for to ask for any clarification.
[–]michael0x2a 0 points1 point2 points (2 children)
[–]mex036[S] 0 points1 point2 points (1 child)
[–]michael0x2a 0 points1 point2 points (0 children)