Closed CrocodileDandy closed 7 years ago
Yes, changing to from . import vimbastructure as structs
should be fine. Submit a PR and I can accept, or can change myself. Thanks.
I cloned, created a new branch with an adapted name, made my change, committed, tried to push my branch, got kicked out by Github, switched to SSH authentication, put my public key on my profile, still getting kicked out. I assumed I had to do that in order to create a PR. What am I doing wrong ?
Hard to diagnose from here. The easiest way is probably to fork it on github, make the changes to your forked repo, then submit a PR.
Done.
Hi,
I currently use Pymba within the following directory structure:
where:
pymba
folder is the wrapper's package main folder,setup.py
because I did not want to install anything on the local Python distributionCamera_AVT.py
contains a camera class using the wrapper through aimport pymba
,Instruments
is in my PYTHONPATH (yes, Windows 10 here),Camera_AVT.py
through afrom Instruments.Cameras.camera_AVT import Camera_AVT
Now when I do that, I get an error while importing
vimbastructure.py
invimba.py
(and elsewhere):So I brushed up my understanding of Python's import logic and understood this is because Python fails a absolute/relative import due to the fact that the
pymba
parent folder is not in the PYTHONPATH (or the PATH) when I try to perform aimport pymba.vimbastructure as structs
.I changed all occurrences of
import pymba.vimbastructure as structs
forfrom . import vimbastructure as structs
in order to perform a proper relative import according to PEP238. It works. So is there a smart reason the import was made withimport pymba.vimbastructure as structs
rather thanfrom . import vimbastructure as structs
and the way I use the package is just not proper ? If not, I would like to ask permission to modify this.FYI,
import pymba.vimbastructure as structs
occurs in: