Question: **I've seen [this](https://stackoverflow.com/questions/17404092/how-to-enable-disable-context-menu-items-on-runtime?lq=1) question, but it didn't help me.**   

The problem is: I'm parsing a website, some posts are personal ones and the other are group posts. If it's a group post, I want to show 2 menuItems in context menu - "Show author's blog" and "Show group's page" and if it's only personal post, only "Show author's blog" menu Item must be shown.

````

```
@Override
     public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo)     {
     super.onCreateContextMenu(menu, v, menuInfo);
     menu.add(0, 1, 0, "Open author's blog" );
     menu.add(0, 2, 0, "Open group's page"); 
 }

 @Override 
 public boolean onContextItemSelected(MenuItem item) { 
     AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo)item.getMenuInfo();
     switch(item.getItemId()) {
     case 1:
        << some code >> 
         break;
     }
     return true; 
 }  

```

````

I can't understand, how can I get this (MenuItem item) in OnCreateContextMenu method. I hope this way I would be able to set some menu items visible or not.

Answer: 
`ImportError: No module named pylons.util` looks like Python cannot find the Pylons package, one of the Python packages that CKAN depends on. Two possibilities come to mind:

1. Did you activate your CKAN virtualenv, before running the paster command? `~/ckan/default/bin/activate`.
2. Have you installed the Python packages that CKAN depends on into your virtualenv? With the virtualenv activated run `pip install -r ~/ckan/default/src/ckan/requirements.txt`

If you activate your CKAN virtual environment and then run `pip freeze | grep pylons`, this should tell you whether pylons is installed in the virtualenv.

The `Distribution already installed:` at the top of your terminal output is strange.
I had the same error and a slightly different solution:

1. got the error only after using `sudo`, so I went out of it (`sudo -k`)
2. then I got the following error: `IOError: [Errno 13] Permission denied: '/etc/ckan/default/development.ini'`
3. after digging around a lot, I finally found out that while the /etc/ckan had correct permissions, it was actually a symlink to `~/ckan/etc` and that folder did not have correct permissions
4. I ran `sudo chown -R `whoami` ~/ckan/etc` and followed up with `paster make-config ckan /etc/ckan/default/development.ini`