On ubuntu jammy, I installed neuron using:
sudo apt install python3-pip
sudo pip3 install neuron
I ran nrgui and it worked.
Then I ran nrnivmodl to compile modules and it completed successfully.
Then I ran again nrngui and got the following error:
Traceback (most recent call last):
File "/home/pfortier/project/x86_64/special.nrn", line 123, in <module>
os.execv(exe, sys.argv)
FileNotFoundError: [Errno 2] No such file or directory
I checked using "ls -l x86_64/special*" and found the file /home/pfortier/project/x86_64/special.nrn does exist:
-rwxr-xr-x 1 pfortier pfortier 4.5K Sep 22 13:21 x86_64/special
-rwxr-xr-x 1 pfortier pfortier 4.5K Sep 22 12:58 x86_64/special.nrn
Furthermore, line 123 of x86_64/special.nrn contains "os.execv(exe, sys.argv)"
I would appreciate help to solve this problem.
os.execv
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: os.execv
In an empty directory launch python 3 from the command line.
In Python execute
from neuron import h
If that works, execute
soma = h.Section("soma")
If something fails, at which step did that happen, and what was the error message?
In Python execute
from neuron import h
If that works, execute
soma = h.Section("soma")
If something fails, at which step did that happen, and what was the error message?
Re: os.execv
All but one file has the same permissions so I used "chmod 750 gstim.mod" instead of 664 to match the others with 750.
I deleted the directory x86_64 and ran nrnivmodl again which completed successfully again.
Then I ran nrngui and it worked perfectly.
The only change made was to the file permission of gstim.mod from 664 to 750 so I must assume that this was the problem.
I deleted the directory x86_64 and ran nrnivmodl again which completed successfully again.
Then I ran nrngui and it worked perfectly.
The only change made was to the file permission of gstim.mod from 664 to 750 so I must assume that this was the problem.
Re: os.execv
No error occurred.
But as mentioned in an addendum, changing the permissions of gstim.mod from 664 to 750 and re-running nrnivmodl solved the issue.
Thanks
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: os.execv
Thanks for the followup! Now I have a question for you:
Given the (to me at least) relatively nonspecific and noninformative error messages, what led you to check the mod file permissions? After all, nrnivmodl completed without complaint.
Given the (to me at least) relatively nonspecific and noninformative error messages, what led you to check the mod file permissions? After all, nrnivmodl completed without complaint.
Re: os.execv
I decided to take a step back towards a tutorial "http://web.mit.edu/neuron_v7.4/nrntuthtml/index.html" suggested by "https://www.neuron.yale.edu/neuron/docs".
running nrngui worked (same as I experienced)
running nrnivmodl to compile the calcium mechanism worked (same as I experienced)
running nrngui worked (this was where an error occurred for my simulation code)
So I concluded that the installation of neuron was good but something in my mod files was wrong. I noticed that the permissions of 1 file were different from the others so I made it the same as the others, re-ran nrnivmodl and discovered that the problem was gone.
Re: os.execv
I glad the problem went away. That's not a bad reason to move on. However I'm quite puzzled how that change could fix aThe only change made was to the file permission of gstim.mod from 664 to 750 so I must assume that this was the problem.
Code: Select all
FileNotFoundError: [Errno 2] No such file or directory
Code: Select all
/home/pfortier/project/x86_64/special.nrn
I'd be curious if your problem returns if you
Code: Select all
chmod 664 gstim.mod
rm -r -f x86_64
nrnivmodl
nrngui
Re: os.execv
Another detail that gave me a bit of an itch but we can ignore for now is
I'd like to modify special.nrn to print the value of exe before line 123.
But when I create a python virtual environment, pip install neuron, and use nrnivmodl in a model folder I happen to have laying around,
I see that x86_64/special.nrn is a binary file. I guess I'm not quite clear where special.nrn came from and will have to figure it out.
Anyway, I suspect (without evidence) that the original problem was somehow related to sudo.
I interpret that as a failure with respect to the value of exe. I.e special.nrn actually exists and tries to execute ' os.execv(exe, sys.argv)File "/home/pfortier/project/x86_64/special.nrn", line 123, in <module>
os.execv(exe, sys.argv)
FileNotFoundError: [Errno 2] No such file or directory
I'd like to modify special.nrn to print the value of exe before line 123.
But when I create a python virtual environment, pip install neuron, and use nrnivmodl in a model folder I happen to have laying around,
I see that x86_64/special.nrn is a binary file. I guess I'm not quite clear where special.nrn came from and will have to figure it out.
Anyway, I suspect (without evidence) that the original problem was somehow related to sudo.