Closed nakajimayoshi closed 1 year ago
@nakajimayoshi Two questions for you:
From the command line, with the pyimagej environment activated, what happens when you run:
python -c 'import imagej; ij = imagej.init(); print(ij.getVersion())'
Does it work? Do you see e.g. "2.13.1" or similar version string printed?
If it works from the command line, but not from your IDE, then it's an issue with how your IDE is configured.
To use a conda environment in PyCharm, you can double-tap shift to bring up the "search everywhere" box, type in "Project structure", and hit enter, which should bring up the dialog box allowing to configure your SDK. The Python SDK you need is an existing conda environment, the one named pyimagej. Point it to your python.exe
executable inside the conda environment. One way to find that python.exe
location is from the command line while pyimagej
is activated:
Get-Item Env:CONDA_PREFIX
Or with cmd.exe
:
echo %CONDA_PREFIX%
I hope that helps. Happy to help troubleshoot further if needed; just reopen this issue with any additional questions.
Windows version: 10.0.19045.2604 Conda version: 23.3.1 Python: 3.10 pip: 23.1.2 IDE: PyCharm Professional 23.1.2 Editor: VSCode V 0.3.3 93b7cc4
Install method: exactly as outlined here
I have made several attempts to get this package working but all have lead me to dead ends. The issue is despite having the build files, packages, and activated environment, my IDE cannot find the "imagej" module. I'm not quite sure what's wrong as I have maven and the jdk installed, this appears when I type
mvn
in powershell:typing
javac -version
yields:javac 17.0.3
I can see the pyimagej folder installed in my conda environment, located at
C:\Users\user\anaconda3\pkgs\pyimagej-1.4.1-py38haa244fe_0
I can tell the pyimagej environment is activated denoted by the parenthesis at the beginning of the powershell prompt
(pyimagej) C:\Users\user\PycharmProjects\kymograph-generator>
typing
pip install pyimagej
yields a long list of 'requirement already satisfied' responses of the sub-dependencies.Ok, so perhaps something is misconfigured in the IDE, I'll try an editor to narrow down the issue. I open the python project with the exact same conda environment using VSC instead of PyCharm. I tried running the following code in VSC:
first I get a "JAVA_HOME" not found error, so I have to manually configure env variables to point to the JDK. After doing so I get this:
typing
java -version
instead ofjavac -version
this time we get:and that is where the trail ends for me. Hope one day this package can be installed via a simple
pip install
as I really have a lot of issues with the imagej macro language to get simple things done.