duoshuo / duoshuo-python-sdk

A Python library for using the duoshuo API
http://duoshuo.com
Apache License 2.0
87 stars 32 forks source link

No such file or directory: 'PKG_PATH/interfaces.json' #6

Closed ghost closed 10 years ago

ghost commented 10 years ago

command:

python manage.py runserver 0.0.0.0:8088

traceback:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/tianyu/.virtualenvs/buzz/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/Users/tianyu/.virtualenvs/buzz/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/tianyu/.virtualenvs/buzz/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/foo/.virtualenvs/buzz/lib/python2.7/site-packages/django/core/management/base.py", line 280, in execute
    translation.activate('en-us')
  File "/Users/foo/.virtualenvs/buzz/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 130, in activate
    return _trans.activate(language)
  File "/Users/foo/.virtualenvs/buzz/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 188, in activate
    _active.value = translation(language)
  File "/Users/foo/.virtualenvs/buzz/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 177, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/Users/foo/.virtualenvs/buzz/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch
    app = import_module(appname)
  File "/Users/foo/.virtualenvs/buzz/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/foo/.virtualenvs/buzz/lib/python2.7/site-packages/duoshuo_python_sdk-0.1-py2.7.egg/duoshuo/__init__.py", line 37, in <module>
    INTERFACES = _parse_json(open(os.path.join(os.path.dirname(__file__), 'interfaces.json'), 'r').read())
IOError: [Errno 2] No such file or directory: '/Users/foo/.virtualenvs/buzz/lib/python2.7/site-packages/duoshuo_python_sdk-0.1-py2.7.egg/duoshuo/interfaces.json'

我进到目录/Users/foo/.virtualenvs/buzz/lib/python2.7/site-packages/duoshuo_python_sdk-0.1-py2.7.egg/duoshuo/i下ls查看确实没有json文件

似乎是setup.py脚本里有点问题

PS,我是从github安装的:pip install git+https://github.com/duoshuo/duoshuo-python-sdk.git

环境: python 2.7 django 1.6.5

perchouli commented 10 years ago

是。setup.py脚本package_data写法有问题。 已经修正了。重新pip安装或者把json文件存到 之前安装在virtualenv的duoshuo包下试试。