From the source code, we can see that pyomo comes with several CPLEX solver interfaces. One of these interfaces requires that the cplex "executable (i.e., the CPLEX "interactive") is in your PATH and I believe this is the default. However, when you install the anaconda cplex package you do not get this executable. This partially explains the error message you are getting.
If you want to use the CPLEXSHELL interface (i.e., the one that shells out to the CPLEX interactive), then you'll need to install one of the IBM ILOG CPLEX Optimization Studio editions (e.g., the free Community Edition) and then update your PATH to point at COS_INSTALL_DIR/cplex/bin/PLATFORM (where COS_INSTALL_DIR is the location you installed CPLEX Optimization Studio and PLATFORM is the platform you installed on (e.g., x86-64_linux)).
Alternatively, and I think this is what you're really trying to do, if you want to use the pyomo interface that connects to the CPLEX Python API, then you just need to fix your environment variables.
Instead of:
export PATH="/home/yash/anaconda3/envs/my_env/lib/python3.6/site-packages/cplex:$PATH"
Try using:
export PYTHONPATH="/home/yash/anaconda3/envs/my_env/lib/python3.6/site-packages:$PYTHONPATH"
Also, it's not entirely clear, but it almost looks like you've installed the cplex package into a Python virtual environment (aka, a virtualenv). If that is the case, then you just need to "activate" the virtualenv, and the cplex package will automatically be accessible. For example, the following might work for you:
cd /home/yash/anaconda3/envs/my_env/
source bin/activate
# use pyomo and cplex here
# when you're done, deactivate the virtualenv, like so:
deactivate
PATHcontains a cplex executable? The cplex executable may be in a sub-directory such asbin/or similar. - Daniel Junglas