-
Notifications
You must be signed in to change notification settings - Fork 52
Can't Imort userlib #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi Zak, Userlib itself isn't intended to be importable, rather its contents are. So for example a module If you need a general-purpose dumping ground for Python modules, that's what (Since pythonlib is in userlib (perhaps a bad decision), As a side effect of the way the labscript suite installation used to work under mercurial, userlib was directly importable - this was because its parent directory (where the labscript suite modules were located) was added to the python path. That was not ideal (lots of random things in the labscript suite install directory were importable as a result), and is not the case anymore after the move to git and standard packaging techniques. So I think this is working as intended! If you can confirm you're able to import your stuff given this explanation, then I'll close this issue. And let me know if I've misunderstood anything! |
Ah I see, I've been writing all of my imports relative to userlib. I think I had somehow tripped the double import denier long ago and decided to always include |
Hi All,
I'm attempting to get labscript running on a new computer with an anaconda developer install on Windows. The installation runs fine but I'm not able to import
userlib
, even after runninglabscript-profile-create
. Instead I getModuleNotFoundError: No module named 'userlib'
. This occurs even with the default values in the labconfig. I'm able to importpythonlib
just fine though.In an interactive session I checked
sys.path
and it includedC:\Users\UserName\labscript-suite\userlib
andC:\Users\UserName\labscript-suite\userlib\pythonlib
. I tried editingsys.path
to move each of those up one directory, sosys.path
then containedC:\Users\UserName\labscript-suite
andC:\Users\UserName\labscript-suite\userlib
. After that I was able to import bothuserlib
andpythonlib
in that interactive session without error.Maybe the parent directories of
userlib
andpythonlib
should be added to path instead?labscript-utils/labscript_profile/__init__.py
Lines 44 to 60 in 2c7deba
Somewhat related: #43
This seems like an issue that others would have run into before so there may be something different about my set up somehow. Maybe it's because this computer never had a mercurial install of labscript on it? I checked
sys.path
on one of our other computers which still has a mercurial labscript install on it, and it included the paths to all three ofC:\Users\UserName\labscript-suite
,C:\Users\UserName\labscript-suite\userlib
andC:\Users\UserName\labscript-suite\userlib\pythonlib
,Cheers,
Zak
The text was updated successfully, but these errors were encountered: