2013-11-27 4 views
8

यदि मैं Anaconda Python Distribution इंस्टॉल करता हूं और 0 डीको अपने django ऐप से चलाने की कोशिश करता हूं, तो नीचे दी गई त्रुटि फेंक दी जाती है। मुझे पता है कि जब मैं एनाकोंडा स्थापित करता हूं, तो यह पाइथन और आईपीथॉन के साथ पैक किया जाता है जिसका संस्करण मेरे पास अन्य पायथन/आईपीथॉन संस्करणों से भिन्न होता है। लेकिन ipython संस्करण के बावजूद, django खोल क्यों एक त्रुटि फेंक देना चाहिए? मैंने सिस्टम ipython को अनइंस्टॉल करने का प्रयास किया और एक ही त्रुटि फेंक दी गई, जिसका अर्थ है कि एनाकोंडा आईपीथॉन वितरण और डीजेंगो के साथ कुछ समस्या है। अनइंस्टॉल करने वाला एनाकोंडा समस्या हल करता है।इंटरएक्टिवशेलएम्बेड के एकाधिक असंगत सबक्लास उदाहरण बनाए जा रहे हैं

स्टैकट्रेस

manage.py in <module>() 
     9 
    10 if __name__ == "__main__": 
---> 11  execute_manager(settings) 

lib/python2.7/site-packages/django/core/management/__init__.pyc in execute_manager(settings_mod, argv) 
    457  setup_environ(settings_mod) 
    458  utility = ManagementUtility(argv) 
--> 459  utility.execute() 

lib/python2.7/site-packages/django/core/management/__init__.pyc in execute(self) 
    380    sys.stdout.write(self.main_help_text() + '\n') 
    381   else: 
--> 382    self.fetch_command(subcommand).run_from_argv(self.argv) 
    383 
    384 def setup_environ(settings_mod, original_settings_path=None): 

lib/python2.7/site-packages/django/core/management/base.pyc in run_from_argv(self, argv) 
    194   options, args = parser.parse_args(argv[2:]) 
    195   handle_default_options(options) 
--> 196   self.execute(*args, **options.__dict__) 
    197 
    198  def execute(self, *args, **options): 

lib/python2.7/site-packages/django/core/management/base.pyc in execute(self, *args, **options) 
    230    if self.requires_model_validation: 
    231     self.validate() 
--> 232    output = self.handle(*args, **options) 
    233    if output: 
    234     if self.output_transaction: 

lib/python2.7/site-packages/django/core/management/base.pyc in handle(self, *args, **options) 
    369   if args: 
    370    raise CommandError("Command doesn't accept any arguments") 
--> 371   return self.handle_noargs(**options) 
    372 
    373  def handle_noargs(self, **options): 

lib/python2.7/site-packages/django_extensions/management/commands/shell_plus.pyc in handle_noargs(self, **options) 
    116     try: 
    117      from IPython import embed 
--> 118      embed(user_ns=imported_objects) 
    119     except ImportError: 
    120      # IPython < 0.11 

lib/python2.7/site-packages/IPython/terminal/embed.pyc in embed(**kwargs) 
    298   config.InteractiveShellEmbed = config.TerminalInteractiveShell 
    299   kwargs['config'] = config 
--> 300  shell = InteractiveShellEmbed.instance(**kwargs) 
    301  shell(header=header, stack_depth=2, compile_flags=compile_flags) 

lib/python2.7/site-packages/IPython/config/configurable.pyc in instance(cls, *args, **kwargs) 
    358    raise MultipleInstanceError(
    359     'Multiple incompatible subclass instances of ' 
--> 360     '%s are being created.' % cls.__name__ 
    361   ) 
    362 

MultipleInstanceError: Multiple incompatible subclass instances of InteractiveShellEmbed are being created. 
+1

मुझे बिल्कुल पता नहीं है, लेकिन मैं खोल को 'python manage.py shell' के रूप में चलाता हूं और यह ipython shell चलाता है। – greg

उत्तर

10

आप

python manage.py shell 

नहीं

ipython manage.py shell 

manage.py खोल उपयोग करना चाहते हैं एक एम्बेडेड IPython उदाहरण शुरू होता है। जब आप ipython manage.py के माध्यम से इसे चलाते हैं, तो आप एक नियमित आईपीथन सत्र शुरू कर रहे हैं, जिसमें आप एक स्क्रिप्ट चलाते हैं जो आईपीथन को एम्बेड करने का प्रयास करता है। इसका मतलब है कि आप आईपीथन के दो उदाहरण शुरू कर रहे हैं। यह विफल रहता है क्योंकि आईपीथन को स्वयं में एम्बेड नहीं किया जा सकता है।

संबंधित मुद्दे