Bad CPU type in executable

I was running AFNI before updating without any problem, but it suddenly doesn’t work with the message below, whenever I am trying to run python files.
Below is the message I received.


env: python: Bad CPU type in executable

AFNI program opens well, but I can’t run ~ .py files.
echo $0 shows ‘tcsh’.

How can I solve the problem?

What is the output of these commands:

afni -ver
which afni
which python
python -V
afni_system_check.py -check_all

Thanks,

  • rick

[Cogs-iMac:/usr/local/bin] coglab% which afni
/Users/coglab/abin/afni
[Cogs-iMac:/usr/local/bin] coglab% which python
/usr/local/bin/python
[Cogs-iMac:/usr/local/bin] coglab% python -V
Python 2.7.16
[Cogs-iMac:/usr/local/bin] coglab% afni_system_check.py -check_all
env: python: Bad CPU type in executable

Outputs are like above.

Are you running conda? How about:

/usr/bin/env which python
/usr/bin/env python -V
  • rick

I once have installed conda before. Here are the outputs.


[Cogs-iMac:~] coglab% /usr/bin/env which python
/usr/local/bin/python
[Cogs-iMac:~] coglab% /usr/bin/env python -V
env: python: Bad CPU type in executable

I got a hint from your reply, and finally solved the problem by removing python installed in /usr/local/bin/ folder !
Now I get following message as an output of ‘which python’.


[Cogs-iMac:~] coglab% which python
/usr/bin/python

Now I can run .py files without any problem.
Thank you for your help :slight_smile:

That’s good.

Note that it suggests there may be other issues to deal with there. If the python that was installed under /usr/local/bin was not appropriate for your machine, there might be many such programs in a similar state. That likely means such files were copied to that computer, rather than being installed.

  • rick