Solved csh ignores PATH?

Hello,

I just met some behaviour I do not understand with
/bin/csh
:
  1. Create a python venv: python3 -m venv --system-site-packages myvenv
  2. Activate it: source myvenv/bin/activate.csh
  3. Check PATH, /usr/home/myuser/myvenv/bin is before /usr/local/bin
  4. Install a python module that comes with executable scripts that also exist in /usr/local/bin, for instance by installing sysutils/iocage and doing a separate python setup.py install from inside the venv.
  5. When I run which iocage or just iocage -v, the one that comes up is the one in /usr/local/bin.
Why is that? I expected the venv one to come up since the venv/bin path came earlier in the PATH environment variable.
 
If you use tcsh (not csh) you can set an internal variable for this.

Code:
autorehash (+)
	       If set, the internal hash table of the contents of the directo-
	       ries in the path	variable will be recomputed if	a  command  is
	       not  found  in the hash table.  In addition, the	list of	avail-
	       able commands will be rebuilt for each  command	completion  or
	       spelling	 correction  attempt if	set to `complete' or `correct'
	       respectively; if	set to `always', this will be  done  for  both
	       cases.

Put it in ~/.cshrc:
Code:
set autorehash
 
Back
Top