-
Notifications
You must be signed in to change notification settings - Fork 11
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
module 'pymaid' has no attribute 'CatmaidInstance' #206
Comments
Your initial errors when trying to But now that you uninstalled and reinstalled, it seems you're now facing a different problem. What pip command did you use to install pymaid? My guess is perhaps you did |
Jasper is likely correct: this looks like a confusion with the packages to me. To confirm, could you send us the output of this: import fafbseg
import pymaid
print(fafbseg.__version__)
print(pymaid.__version__)
print(dir(pymaid)) |
When I reinstalled pymaid, I believe I did use Also, @schlegelp here is the results of those commands.
0.2.10
0.3.8.post4
['all', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'version', 'channel', 'conf', 'connection', 'error', 'pb', 'pool', 'serve_forever', 'utils', 'websocket'] |
OK, that looks like you accidentally installed the other pymaid. Try this: pip3 uninstall pymaid
pip3 install python-catmaid -U |
Okay, I think this worked. Were some of the methods tweaked in pymaid 1.1.0? I received this error when I set the catmaid instance...
That was easy enough to fix, but then when I ran Full traceback was
|
Ah right: you will also need to update fafbseg. The bottom line is this: As a consequence
Even independent of pymaid, |
Thank you! This is very helpful. Just one last thing. I have been using brainmaps to fetch the data, however it says that |
That's what I meant here: you don't need to set a segmentation source anymore. Your link to "general setup" is outdated and doesn't exist anymore in the most recent docs. I'm surprised it's still accessible - have you had it bookmarked? Possibly you need to deep reload (alt + refresh) the page. In any event: just check out this tutorial |
Ah, I missed that part. Okay, that actually leads me to another issue. The link you sent was the original tutorial I used after installing the new version of fafbseg. I was able to fetch the correct neuron using I tried it both with least number of parameters required (just neuron, target instance, tag) and my normal list of parameters (neuron, instance, tag, min node overlap, min overlap size, merge limit, min upload size, min upload node). I thought maybe it was due to not setting the segmentation source. The traceback is quite a big longer than last time. I can post it if it would help. As for how I accessed that doc. From that page you linked, I can access it by clicking "Examples" in the top right in-between API and Github. Then, I can click on "General Setup" towards the bottom of the page. I tried a deep reload and it was still there. |
OK that looks like a bug - I will check that. Re the docs: try deep reload to clear your cache. |
Turns out this was an error on my part in I have pushed a new version pip3 install python-catmaid -U Let me know if that fixes things. |
Darn it! Ok, another hot fix - this time in pip3 install navis -U And try again. On my machine I reach the final step of import now. |
Okay, I was able to get to the stage where I can view overlapping neurons, but then I got an error related to Vispy and OpenGL (since I got the warning when importing fafbseg that I was not able to load OpenGL library). The first error was
The full traceback is significantly longer and doesn't have the nice color coding.
|
That looks like an issue with vispy or PyQt5. Am I correct in that it used to work on your machine and other than updating fafbseg/navis/pymaid you have not changed anything else (like drivers)? If so, could you run this:
and send me the version of anything that has |
Yes, I've been using this machine to work from home since march and I've been using fafbseg to import my google autoseg neurons. I haven't changed any drivers to my knowledge (not sure how updating my macOS to the newest version would affect drivers). Interestingly, I just tried to run the whole process again and after getting that same error, I tried quitting out with quit() and enter and it brought me to the next stage (selecting which neurons to merge). I think you're right that it's just an issue with the visualization. When I ran pip3 list, I found
|
Could you try with an earlier version of PyQt5?
Make sure to restart your Python session after the install and before trying it again. |
Hi Philipp, sorry I thought I hit comment. I still have the openGL issue, but I was able to successfully* import the neuron. For some reason, after I chose which neuron to merge mine into and started the import process, there was some delay and I eventually got this error... Processing neuron "Google: 2266429077" (197004135) [0/1]
Done.
Extracting new nodes to upload... Done.
---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
<ipython-input-3-6e42ff7ea7fb> in <module>
14 x = pymaid.get_neuron(197004135, remote_instance=auto)
15
---> 16 resp = fafbseg.move.merge_into_catmaid(x, target_instance=manual, tag="wilson_lab", min_node_overlap=4, min_overlap_size=1, merge_limit=.75, min_upload_size=3, min_upload_nodes=1)
~/.pyenv/versions/3.8.2/envs/fafbseg/lib/python3.8/site-packages/fafbseg/utils.py in wrapper(*args, **kwargs)
83 try:
84 # Execute function
---> 85 res = function(*args, **kwargs)
86 except BaseException:
87 raise
~/.pyenv/versions/3.8.2/envs/fafbseg/lib/python3.8/site-packages/fafbseg/move/merge.py in merge_into_catmaid(x, target_instance, tag, min_node_overlap, min_overlap_size, merge_limit, min_upload_size, min_upload_nodes, update_radii, import_tags, label_joins, sid_from_nodes, mesh)
378 source_info = {}
379
--> 380 resp = pymaid.upload_neuron(f,
381 import_tags=import_tags,
382 import_annotations=False,
~/.pyenv/versions/3.8.2/envs/fafbseg/lib/python3.8/site-packages/pymaid/cache.py in wrapper(*args, **kwargs)
175 rm.caching = False
176 # Execute function
--> 177 res = function(*args, **kwargs)
178 # Set caching to old value
179 rm.caching = old_value
~/.pyenv/versions/3.8.2/envs/fafbseg/lib/python3.8/site-packages/pymaid/upload.py in upload_neuron(x, import_tags, import_annotations, import_connectors, reuse_existing_connectors, skeleton_id, neuron_id, force_id, source_id, source_project_id, source_url, source_type, remote_instance)
512 # to have a log of it without interrupting potential subsequent uploads.
513 try:
--> 514 resp = remote_instance.fetch(import_url,
515 post=import_post,
516 files={'file': file})
~/.pyenv/versions/3.8.2/envs/fafbseg/lib/python3.8/site-packages/pymaid/client.py in fetch(self, url, post, files, on_error, desc, disable_pbar, leave_pbar, return_type)
471 if errors:
472 if on_error == 'raise':
--> 473 raise HTTPError('{} errors encountered: {}'.format(len(errors),
474 '\n'.join(errors)))
475 else:
HTTPError: 1 errors encountered: 500 Server Error: duplicate key value violates unique constraint "skeleton_origin_pkey1"
DETAIL: Key (id)=(19996) already exists.
for url: https://neuropil.janelia.org/tracing/fafb/v14/1/skeletons/import When I checked v14 my cell is there, but I just don't know if this will end up causing any issues down the line. |
Does this happen every single time? This could be a one time glitch due to how the CATMAID server backend imports the new data. If that's the case, the upload will have stopped at some point - since the larger new branches are uploaded first, it may look like your neuron is complete but in fact some branches will still be missing. If it really is this one time glitch, you can just restart the merge process. By-the-by: I edited your above post to format the error message as code (using ``` at the beginning and the end) - much easier to read. |
The openGL issue happens every time. The new one with the duplicate key pair has just happened once. I believe you are right. The neuron in autoseg is about 100 nodes longer than the neuron in v14. I'll merge again. And thanks for the edit! I didn't know github was able to format the traceback so nicely. When I tried using the code option for the openGL long error message a few comments ago, it didn't make a big difference. Good to know for the future! |
Did you try downgrading PyQt5 as I suggested?
|
Yeah, I tried that last week. That hasn't fixed it. Pip list shows it as 5.14.2 and just to double check, when I load up iPython to check the version I get this.
|
Hmm. This looks like an issue with library used to build the 3D viewer, $ cd ~/Downloads
$ python3 mesh.py |
So I got this error which seems to relate to this issue on their github vispy/vispy#1885
|
Different error but at least it's something something tangible. If I read that thread correctly, you could try switching Python versions to 3.7 or 3.9? |
Ah yes, I'll try that. I use pyenv for managing my python environments and I was running into errors with trying to install either python 3.7 or 3.9. Something about my computer using macOS Big Sur and my current xcode version. I'm going to try to sort that out this morning. |
Just FYI re the duplicate key error. Turns out that's an issue with the CATMAID server and Tom Kazimiers has fixed the data base but is not quite sure where it came from in the first place. So your imports should work now but we need to keep an eye on it and let Tom know if it pops up again. |
Thanks for the update! |
Re the issue with vispy and BigSur, I posted a work around that will let you import navis and use non-vispy related functions: |
Hi, I recently got an error when attempting to import a neuron from the google auto-seg Catmaid instance to V14. I have been doing this same process for the past year or so without any issues.
I am running on macOS Big Sur. I currently use pyenv to manage my environment, which is running python 3.8.3. I use ipython to run the fafbseg/pymaid commands. When I first tried to use
import fafbseg
andimport pymaid
within ipython, I received an error saying that it didn't recognize those modules (I don't remember it verbatim). I uninstalled pymaid and reinstalled it using pip, which got rid of that original error. Now, I am able to import fafbseg and pymaid without errors. However, now when I try to set the catmaid instance usingpymaid.CatmaidInstance
, I get the errorAttributeError: module 'pymaid' has no attribute 'CatmaidInstance'
. I'm not sure if it's an issue with my python version, my virtual environment, or maybe my updated macOS. I have been using the same virtual environment for the past year. Any advice?The text was updated successfully, but these errors were encountered: