joequery / SnipSnip

Local code snippet database run from your terminal. (Work in progress)
4 stars 0 forks source link

Unable to launch (permissions error) #1

Closed onyxfish closed 12 years ago

onyxfish commented 12 years ago

Hey Justin, I just went to give this a shot and ran into this:

Traceback (most recent call last):
  File "/usr/local/bin/snipsnip", line 5, in <module>
    pkg_resources.run_script('SnipSnip==1.0', 'snipsnip')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 489, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1214, in run_script
    exec script_code in namespace, namespace
  File "/Library/Python/2.7/site-packages/SnipSnip-1.0-py2.7.egg/EGG-INFO/scripts/snipsnip", line 7, in <module>

  File "build/bdist.macosx-10.7-intel/egg/snip/search.py", line 224, in <module>
  File "build/bdist.macosx-10.7-intel/egg/snip/search.py", line 26, in __init__
  File "build/bdist.macosx-10.7-intel/egg/whoosh/index.py", line 91, in create_in
  File "build/bdist.macosx-10.7-intel/egg/whoosh/filedb/filestore.py", line 60, in create_index
  File "build/bdist.macosx-10.7-intel/egg/whoosh/filedb/fileindex.py", line 89, in _create_index
  File "build/bdist.macosx-10.7-intel/egg/whoosh/filedb/fileindex.py", line 99, in _write_toc
  File "build/bdist.macosx-10.7-intel/egg/whoosh/filedb/filestore.py", line 79, in create_file
IOError: [Errno 13] Permission denied: '/Users/onyxfish/.snipsnip/index/_MAIN_0.toc.1325090411.24'
onyxfish commented 12 years ago

Ah, this is probably because I sudo installed it, but am running it as my normal user. So those index files were created as root.

onyxfish commented 12 years ago

I'd suggest having those directories created at runtime if they don't exist, rather than in setup.py.

joequery commented 12 years ago

The ~/.snipsnip directory and all subfolders need to be writable. I put that info in the readme, but I guess I could be more clear. I attempted to make a writable directory via the os package but wasn't able to, so I've asked the users to do it themselves through the shell.

joequery commented 12 years ago

And the name's Joseph, you big jerk!

onyxfish commented 12 years ago

Doh! (on both counts) Sorry about that. I was in communication with your cohort at the same time I was writing this. Apparently my wires crossed.

onyxfish commented 12 years ago

Since this thread is open now, I'll just put my thoughts here. Bullet-pointed:

Hope that helps! Chris

joequery commented 12 years ago

Awesome feedback, thanks a ton! Could you elaborate on your last point?

onyxfish commented 12 years ago

I was thinking something like:

Just a thought.

onyxfish commented 12 years ago

You might want to take a look at how I do the argument parsing stuff in csvkit:

https://github.com/onyxfish/csvkit/blob/master/csvkit/cli.py

Or, for something more robust, you can check out Cement:

http://cement.readthedocs.org/en/0.8.18/index.html

joequery commented 12 years ago

I've broken your suggestions out into multiple issues. Thanks a bunch! (Yes, necropost ftw!)