graphite/carbon ImportError: No module named fields
graphite/carbon ImportError: No module named fields
我几乎能听懂所有的指示here
但是当我到达
[idf@node1 graphite]$ cd /opt/graphite/webapp/graphite/
[idf@node1 graphite]$ sudo python manage.py syncdb
Could not import graphite.local_settings, using defaults!
/opt/graphite/webapp/graphite/settings.py:244: UserWarning: SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security
warn('SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security')
ImportError: No module named fields
[idf@node1 graphite]$
不确定为什么会出现此错误?
我也试过这些指令,它大约在同一个地方挂了
[idf@node1 graphite]$ sudo PYTHONPATH=/opt/graphite/webapp/ django-admin.py syncdb --settings=graphite.settings
/var/tmp/sclHwyLM6: line 8: PYTHONPATH=/opt/graphite/webapp/: No such file or directory
[idf@node1 graphite]$
如果我回显 PYTHONPATH,我得到
[idf@node1 ~]$ echo $PYTHONPATH
/usr/lib64/python2.7/site-packages/openmpi
[idf@node1 ~]$
然后我创建了
/etc/profile.d/local_python.sh
内容
PYTHONPATH="/opt/graphite/webapp/":"${PYTHONPATH}"
export PYTHONPATH
我创建了一个新的 shell 并且 echo 现在看起来是正确的
[idf@node1 graphite]$ echo $PYTHONPATH
/opt/graphite/webapp/:/usr/lib64/python2.7/site-packages/openmpi
[idf@node1 graphite]$
现在我运行
[idf@node1 graphite]$ sudo django-admin.py syncdb --settings=graphite.settings
Traceback (most recent call last):
File "/home/idf/anaconda/bin/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/home/idf/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/home/idf/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/idf/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 263, in fetch_command
app_name = get_commands()[subcommand]
File "/home/idf/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 109, in get_commands
apps = settings.INSTALLED_APPS
File "/home/idf/anaconda/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/home/idf/anaconda/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in _setup
self._wrapped = Settings(settings_module)
File "/home/idf/anaconda/lib/python2.7/site-packages/django/conf/__init__.py", line 134, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'graphite.settings' (Is it on sys.path?): No module named graphite.settings
[idf@node1 graphite]$
ImportError:无法导入设置 'graphite.settings'(是否在 sys.path 上?):没有名为 graphite.settings[=20= 的模块]
[idf@node1 graphite]$ pwd
/opt/graphite/webapp/graphite
[idf@node1 graphite]$ ls
account composer local_settings.pyc node.py storage.py version
app_settings.py dashboard local_settings.py.example node.pyc storage.pyc views.py
app_settings.pyc events logger.py readers.py templates views.pyc
browser finders logger.pyc readers.pyc thirdparty whitelist
carbonlink.py __init__.py manage.py remote_storage.py url_shortener wsgi.py
carbonlink.pyc __init__.pyc manage.pyc remote_storage.pyc urls.py wsgi.pyc
cli intervals.py metrics render urls.pyc
compat.py intervals.pyc middleware.py settings.py util.py
compat.pyc local_settings.py middleware.pyc settings.pyc util.pyc
[idf@node1 graphite]$
我可以通过像这样替换路径来让它工作
sudo django-admin.py syncdb --settings=graphite.settings
像这样的路径
sudo /home/idf/anaconda/bin/django-admin.py syncdb --pythonpath /opt/graphite/webapp --settings graphite.settings
使用以下命令将包 django-tagging
(0.3.6) 降级后,问题已解决:
pip uninstall django-tagging
pip install 'django-tagging<0.4'
@培工妥善解决。我将对问题进行解释。
django-tagging 0.4 需要新版本的 Django 1.7 或更高版本以及 Python 2.7 或更高版本。将 django-tagging 降级到 0.3.6 将适用于较旧的 Django,例如 Django 1.5
pip uninstall django-tagging
pip install django-tagging===0.3.6
或在 CM
python_pip "django-tagging" do
version "0.3.6"
end
在此处查看更改日志和有关 django 标记的更多信息:
https://pypi.python.org/pypi/django-tagging
我几乎能听懂所有的指示here
但是当我到达
[idf@node1 graphite]$ cd /opt/graphite/webapp/graphite/
[idf@node1 graphite]$ sudo python manage.py syncdb
Could not import graphite.local_settings, using defaults!
/opt/graphite/webapp/graphite/settings.py:244: UserWarning: SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security
warn('SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security')
ImportError: No module named fields
[idf@node1 graphite]$
不确定为什么会出现此错误?
我也试过这些指令,它大约在同一个地方挂了
[idf@node1 graphite]$ sudo PYTHONPATH=/opt/graphite/webapp/ django-admin.py syncdb --settings=graphite.settings
/var/tmp/sclHwyLM6: line 8: PYTHONPATH=/opt/graphite/webapp/: No such file or directory
[idf@node1 graphite]$
如果我回显 PYTHONPATH,我得到
[idf@node1 ~]$ echo $PYTHONPATH
/usr/lib64/python2.7/site-packages/openmpi
[idf@node1 ~]$
然后我创建了
/etc/profile.d/local_python.sh
内容
PYTHONPATH="/opt/graphite/webapp/":"${PYTHONPATH}"
export PYTHONPATH
我创建了一个新的 shell 并且 echo 现在看起来是正确的
[idf@node1 graphite]$ echo $PYTHONPATH
/opt/graphite/webapp/:/usr/lib64/python2.7/site-packages/openmpi
[idf@node1 graphite]$
现在我运行
[idf@node1 graphite]$ sudo django-admin.py syncdb --settings=graphite.settings
Traceback (most recent call last):
File "/home/idf/anaconda/bin/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/home/idf/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/home/idf/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/idf/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 263, in fetch_command
app_name = get_commands()[subcommand]
File "/home/idf/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 109, in get_commands
apps = settings.INSTALLED_APPS
File "/home/idf/anaconda/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/home/idf/anaconda/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in _setup
self._wrapped = Settings(settings_module)
File "/home/idf/anaconda/lib/python2.7/site-packages/django/conf/__init__.py", line 134, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'graphite.settings' (Is it on sys.path?): No module named graphite.settings
[idf@node1 graphite]$
ImportError:无法导入设置 'graphite.settings'(是否在 sys.path 上?):没有名为 graphite.settings[=20= 的模块]
[idf@node1 graphite]$ pwd
/opt/graphite/webapp/graphite
[idf@node1 graphite]$ ls
account composer local_settings.pyc node.py storage.py version
app_settings.py dashboard local_settings.py.example node.pyc storage.pyc views.py
app_settings.pyc events logger.py readers.py templates views.pyc
browser finders logger.pyc readers.pyc thirdparty whitelist
carbonlink.py __init__.py manage.py remote_storage.py url_shortener wsgi.py
carbonlink.pyc __init__.pyc manage.pyc remote_storage.pyc urls.py wsgi.pyc
cli intervals.py metrics render urls.pyc
compat.py intervals.pyc middleware.py settings.py util.py
compat.pyc local_settings.py middleware.pyc settings.pyc util.pyc
[idf@node1 graphite]$
我可以通过像这样替换路径来让它工作
sudo django-admin.py syncdb --settings=graphite.settings
像这样的路径
sudo /home/idf/anaconda/bin/django-admin.py syncdb --pythonpath /opt/graphite/webapp --settings graphite.settings
使用以下命令将包 django-tagging
(0.3.6) 降级后,问题已解决:
pip uninstall django-tagging
pip install 'django-tagging<0.4'
@培工妥善解决。我将对问题进行解释。
django-tagging 0.4 需要新版本的 Django 1.7 或更高版本以及 Python 2.7 或更高版本。将 django-tagging 降级到 0.3.6 将适用于较旧的 Django,例如 Django 1.5
pip uninstall django-tagging
pip install django-tagging===0.3.6
或在 CM
python_pip "django-tagging" do
version "0.3.6"
end
在此处查看更改日志和有关 django 标记的更多信息: https://pypi.python.org/pypi/django-tagging