Note: When Python is run on ImageJ Fiji, java.lang.IllegalArgumentException appears and its solution (mac OS)

Introduction

When I installed the open source software "ImageJ Fiji" used for image analysis on mac OS and tested it with Python, mainly in life sciences, from the beginning. I got a Java error message and was struck by my nose. I couldn't find an entry written on the net about the solution, so I'll take note of it and think that it might be useful for someone.

Operating environment

Error summary

When you open the Python file created in advance with Fiji and move it ... th_スクリーンショット 2020-10-10 20.41.54 21.05.44.png A Java error message will appear. th_スクリーンショット 2020-10-10 20.42.02 21.05.44.png The error is written as follows ...

java.lang.IllegalArgumentException: Cannot create PyString with non-byte value

When I checked it, it was an error that occurred when double-byte characters were included in the argument of PyString.

Solution (maybe)

It seems that the problem was that ** the file path of the Python file to be operated contains double-byte characters **. It was solved by changing the name of the folder containing the operation file to alphabet. Easy!

After trying various things, the one related to this error is --Target file name --All folder names included in the target file path I think it is.

If you open the image file in Fiji and activate it, there is no problem with a file path that includes double-byte characters, but if you specify the path on the Python side and open it, you need to make it a path that does not include double-byte characters as well. That's right.

As a precaution, I also tried deleting the .localized file in my home directory, but it had nothing to do with the operation.

Impressions

To stumble in such an easy place ... That's right, no one has written anything!

Recommended Posts

Note: When Python is run on ImageJ Fiji, java.lang.IllegalArgumentException appears and its solution (mac OS)
Error and solution when installing python3 with homebrew on mac (catalina 10.15)
Run Zookeeper x python (kazoo) on Mac OS X
When import tkinter is not possible on Mac OS X 10.11.3 (El Capitan) + pyenv + Python 3.5.1.
Install lp_solve on Mac OS X and call it with python.
Memorandum of understanding when Python is run on EC2 with Apache
Notes on setting pyenv and python environment using Homebrew on Mac OS Marvericks
python note: when easy_install is not available
Notes on building Python and pyenv on Mac
Run NASA CEA on Mac OS X
Make a Python program a daemon and run it automatically when the OS starts
Solution when aws-cli cannot be executed on Mac virtual environment (after installing Python 3.8)
Install and run Python3.5 + NumPy + SciPy on Windows 10
Preparing to run ImageMagick + im4java on Mac OS
Note on encoding when LANG = C in Python
[Note] Installing Python 3.6 + α on Windows and RHEL
Shpinx (Python documentation builder) on Mac OS X
Try importing MLB data on Mac and Python