Skip to content
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

Unicode Error #3

Open
jawoll14 opened this issue Sep 17, 2018 · 4 comments
Open

Unicode Error #3

jawoll14 opened this issue Sep 17, 2018 · 4 comments

Comments

@jawoll14
Copy link

I am currently trying to convert the following .vsi files into .tif files.

20180910_stimulated yfp_YFP-f_003_current
20180911_csf1after5min stimulated flms_PH_001_current
sad323-00a6ls04:untitled folder jared$ python -m microscoper --list
./20180910_stimulated yfp_YFP-f_003_current/stack1/20180910_stimulated yfp_YFP-f_003_current.vsi
./20180911_csf1after5min stimulated flms_PH_001_current/stack1/20180911_csf1after5min stimulated flms_PH_001_current.vsi

Total files found: 2

When I try to convert the following files into the tif format using the command python -m microscoper. I get the following output. One .tif file is created, but it gets stuck and doesn't process the rest of the files. I was able to get this working on my old macbook, but I recently got a new macbook and had to download it onto my new one, but I am having trouble getting it to work. I can open my files through imageJ using bioformats, but this can save me a lot of time to convert many files at once. Thanks

Traceback (most recent call last): | 0/2 [00:00<?, ?it/s]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main██████████| 100/100 [00:00<00:00, 102.77it/s]
"main", fname, loader, pkg_name)█████████| 1/1 [00:00<00:00, 127.46it/s]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Users/jared/microscoper/microscoper/main.py", line 3, in
run()
File "/Users/jared/microscoper/microscoper/io.py", line 212, in run
save_metadata(metadata, save_directory)
File "/Users/jared/microscoper/microscoper/io.py", line 138, in save_metadata
xmlfile.write(pretty_xml_as_string)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb5' in position 565: ordinal not in range(128)

@pskeshu
Copy link
Owner

pskeshu commented Sep 18, 2018

It's probably because you're running it on python2, and python-bioformats has some problem reading unicode characters from the metadata associated with .vsi files.

Installing the python3 version of microscoper will solve the problem.

@pskeshu
Copy link
Owner

pskeshu commented Sep 18, 2018

BTW, you can also now run microscoper directly, without having to call it through python -m microscoper.

@jawoll14
Copy link
Author

Hi, thanks for getting back to me so soon. So, I uninstalled python and reinstalled python 3 on my macbook, and then reinstalled microscoper, but now I have a new problem. I tried uninstalling both javabridge and microscoper and then reinstalling each of them after I got this error, but I still get the same error. Thanks

Traceback (most recent call last):
File "/Users/jared/miniconda3/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/Users/jared/miniconda3/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/Users/jared/miniconda3/lib/python3.6/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/Users/jared/miniconda3/lib/python3.6/site-packages/microscoper/init.py", line 1, in
from .io import run
File "/Users/jared/miniconda3/lib/python3.6/site-packages/microscoper/io.py", line 13, in
import bioformats as bf
File "/Users/jared/miniconda3/lib/python3.6/site-packages/bioformats/init.py", line 21, in
import javabridge
File "/Users/jared/miniconda3/lib/python3.6/site-packages/javabridge/init.py", line 38, in
from .jutil import start_vm, kill_vm, vm, activate_awt, deactivate_awt
File "/Users/jared/miniconda3/lib/python3.6/site-packages/javabridge/jutil.py", line 157, in
import javabridge._javabridge as _javabridge
ImportError: dlopen(/Users/jared/miniconda3/lib/python3.6/site-packages/javabridge/_javabridge.cpython-36m-darwin.so, 2): Symbol not found: _kCFAllocatorDefault
Referenced from: /Users/jared/miniconda3/lib/python3.6/site-packages/javabridge/_javabridge.cpython-36m-darwin.so
Expected in: flat namespace
in /Users/jared/miniconda3/lib/python3.6/site-packages/javabridge/_javabridge.cpython-36m-darwin.so

@pskeshu
Copy link
Owner

pskeshu commented Sep 18, 2018

Seems like a conda specific python-javabridge error. Can you try reinstalling python-javabridge or install the latest version from their github repo?

Similar problem was reported here: LeeKamentsky/python-javabridge#136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants