No module named graphite.settings
hi, I used "PYTHONPATH=$GRAPHITE_ROOT/webapp django-admin.py migrate --settings=graphite.settings --run-syncdb" to set up a new database, but the terminal show some error:
Traceback (most recent call last):
File "/usr/local/bin/django-admin.py", line 5, in
I'm a little confused, can you explain why??
Have you found the solution?
For anyone else running into this, try running it without the PYTHONPATH variable to make sure it isn't an issue with the PATH. Find the settings file location and run from there e.g. cd /opt/graphite/webapp/graphite
then
django-admin.py migrate --settings=graphite.settings --run-syncdb
good call shammy12.
I still get the following error
ubuntu@ip-172-31-27-43:/opt/graphite/webapp/graphite$ django-admin.py migrate --settings=graphic.settings --run-syncdb
Traceback (most recent call last):
File "/usr/local/bin/django-admin.py", line 5, in
Dublicate of #1867. @saifromeo : Try to run
cd /opt/graphite/webapp/
PYTHONPATH=/opt/graphite/webapp django-admin.py migrate --settings=graphite.settings --run-syncdb
This is hitting me also. All the graphite releases since 1.0.0 are giving me this error.
A bit more information: I'm installing on Centos7 into a python2.7 virtualenv. it doesnt matter which of the 1.x.y series releases I install from github, I always receive the "ImportError: No module named graphite.settings" that OP reports. It doesnt matter if i activate my virtualenv first, and it doesnt matter if I prefix my command with "PYTHONPATH=/opt/graphite/webapp", or if I cd into my /opt/graphite/webapp/graphite/ directory and run from there. I always receive this:
Traceback (most recent call last):
File "/opt/graphite/bin/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "/opt/graphite/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/opt/graphite/lib/python2.7/site-packages/django/core/management/__init__.py", line 302, in execute
settings.INSTALLED_APPS
File "/opt/graphite/lib/python2.7/site-packages/django/conf/__init__.py", line 55, in __getattr__
self._setup(name)
File "/opt/graphite/lib/python2.7/site-packages/django/conf/__init__.py", line 43, in _setup
self._wrapped = Settings(settings_module)
File "/opt/graphite/lib/python2.7/site-packages/django/conf/__init__.py", line 99, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named graphite.settings
The command I am attempting is:
PYTHONPATH=/opt/graphite/webapp /opt/graphite/bin/django-admin.py migrate auth --settings=graphite.settings --noinput
PYTHONPATH=/opt/graphite/webapp /opt/graphite/bin/django-admin.py migrate --settings=graphite.settings --noinput --run-syncdb
I suspecting it's because of some Centos-specific things but I have no idea which things exactly...
which version of Django are you trying, @cixelsyd ?
I tried both 1.8 and 1.11 and they both exhibited the same behavior.
Just tried it on a quite clean centos7 and it just works for me. Are you sure you cd into the correct directory?
yum install python-virtualenv libffi-devel python-devel gcc
virtualenv /opt/venv
source /opt/venv/bin/activate
pip install -U setuptools
pip install -U carbon
pip install -U graphite-web
cd /opt/graphite/webapp
PYTHONPATH=/opt/graphite/webapp/ django-admin migrate --settings=graphite.settings --run-syncdb
thank you very much for your efforts, i will verify today or this weekend and post my results.
mobile
On Apr 20, 2018, at 4:56 AM, Piotr Popieluch [email protected] wrote:
Just tried it on a quite clean centos7 and it just works for me. Are you sure you cd into the correct directory?
yum install python-virtualenv libffi-devel python-devel gcc virtualenv /opt/venv source /opt/venv/bin/activate pip install -U setuptools pip install -U carbon pip install -U graphite-web cd /opt/graphite/webapp PYTHONPATH=/opt/graphite/webapp/ django-admin migrate --settings=graphite.settings --run-syncdb — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Seems the same problem at Ubuntu 18.04
I installed graphite with this tutorial https://www.christian-klemm.de/icingaweb2-graphite-modul/ At the point "sudo graphite-manage syncdb " I get the following errors:
root@icinga2:/# sudo graphite-manage syncdb
Traceback (most recent call last):
File "/usr/bin/graphite-manage", line 15, in
@mknornschild: Looks like a completely different issue to me. Sorry, I can't read German, but looks like your manual is broken somehow. Not sure which version of Graphite is in Ubuntu 18.04 packets, also Django 1.4 is probably too old. We officially recommend to install Graphite from sources or use Docker image.