2016-05-10 21 views
5

में काम नहीं कर रहा है जैसा मैंने the official guide बताया था।आईपीथन नोटबुक Pycharm

मेरे लिए मैं इस विंडो नहीं था पॉप अप जब मैं Run बटन enter image description here

क्लिक हालांकि, जब मैं Run बटन यह सिर्फ काम नहीं कर रहा था पर क्लिक करें और ब्रैकेट में एक * दिखाया। enter image description here

टर्मिनल में:

ipython notebook 
[I 21:25:20.940 NotebookApp] Serving notebooks from local directory: /Users/yangyy/GitHub/Signal&System 
[I 21:25:20.941 NotebookApp] 0 active kernels 
[I 21:25:20.941 NotebookApp] The IPython Notebook is running at: http://localhost:8888/ 
[I 21:25:20.941 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). 
[W 21:25:24.439 NotebookApp] 404 GET /api/kernels/e905abbe-caad-458e-a50b-a48b7dbcc6ab/channels?session_id=16F0F228133A41AC84E1A2A71F1064F2 (::1): Kernel does not exist: e905abbe-caad-458e-a50b-a48b7dbcc6ab 
[W 21:25:24.446 NotebookApp] 404 GET /api/kernels/e905abbe-caad-458e-a50b-a48b7dbcc6ab/channels?session_id=16F0F228133A41AC84E1A2A71F1064F2 (::1) 14.19ms referer=None 
[E 21:25:30.370 NotebookApp] Notebook JSON is not valid v3: Additional properties are not allowed (u'cells' was unexpected) 

    Failed validating u'additionalProperties' in schema: 
     {u'$schema': u'http://json-schema.org/draft-04/schema#', 
     u'additionalProperties': False, 
     u'definitions': {u'code_cell': {u'additionalProperties': False, 
             u'description': u'Notebook code cell.', 
             u'properties': {u'cell_type': {u'description': u'String identifying the type of cell.', 
                     u'enum': [u'code']}, 
                 u'collapsed': {u'description': u'Whether the cell is collapsed/expanded.', 
                     u'type': u'boolean'}, 
                 u'input': {u'$ref': u'#/definitions/misc/source'}, 
                 u'language': {u'description': u"The cell's language (always Python)", 
                     u'type': u'string'}, 
                 u'metadata': {u'additionalProperties': True, 
                     u'description': u'Cell-level metadata.', 
                     u'type': u'object'}, 
                 u'outputs': {u'description': u'Execution, display, or stream outputs.', 
                     u'items': {u'$ref': u'#/definitions/output'}, 
                     u'type': u'array'}, 
                 u'prompt_number': {u'description': u"The code cell's prompt number. Will be null if the cell has not been run.", 
                      u'minimum': 0, 
                      u'type': [u'integer', 
                         u'null']}}, 
             u'required': [u'cell_type', 
                 u'input', 
                 u'outputs', 
                 u'language'], 
             u'type': u'object'}, 
          u'display_data': {u'additionalProperties': False, 
              u'description': u'Data displayed as a result of code cell execution.', 
              u'patternProperties': {u'[a-zA-Z0-9]+/[a-zA-Z0-9\\-\\+\\.]+$': {u'$ref': u'#/definitions/misc/multiline_string', 
                              u'description': u'mimetype output (e.g. text/plain), represented as either an array of strings or a string.'}}, 
              u'properties': {u'html': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                  u'javascript': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                  u'jpeg': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                  u'json': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                  u'latex': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                  u'metadata': {u'$ref': u'#/definitions/misc/output_metadata'}, 
                  u'output_type': {u'description': u'Type of cell output.', 
                      u'enum': [u'display_data']}, 
                  u'pdf': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                  u'png': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                  u'svg': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                  u'text': {u'$ref': u'#/definitions/misc/multiline_string'}}, 
              u'required': [u'output_type'], 
              u'type': u'object'}, 
          u'heading_cell': {u'additionalProperties': False, 
              u'description': u'Notebook heading cell.', 
              u'properties': {u'cell_type': {u'description': u'String identifying the type of cell.', 
                      u'enum': [u'heading']}, 
                  u'level': {u'description': u'Level of heading cells.', 
                     u'minimum': 1, 
                     u'type': u'integer'}, 
                  u'metadata': {u'additionalProperties': True, 
                      u'description': u'Cell-level metadata.', 
                      u'type': u'object'}, 
                  u'source': {u'$ref': u'#/definitions/misc/source'}}, 
              u'required': [u'cell_type', 
                  u'source', 
                  u'level'], 
              u'type': u'object'}, 
          u'markdown_cell': {u'additionalProperties': False, 
              u'description': u'Notebook markdown cell.', 
              u'properties': {u'cell_type': {u'description': u'String identifying the type of cell.', 
                      u'enum': [u'markdown', 
                         u'html']}, 
                  u'metadata': {u'additionalProperties': True, 
                      u'description': u'Cell-level metadata.', 
                      u'properties': {u'name': {u'$ref': u'#/definitions/misc/metadata_name'}, 
                          u'tags': {u'$ref': u'#/definitions/misc/metadata_tags'}}, 
                      u'type': u'object'}, 
                  u'source': {u'$ref': u'#/definitions/misc/source'}}, 
              u'required': [u'cell_type', 
                  u'source'], 
              u'type': u'object'}, 
          u'misc': {u'metadata_name': {u'description': u"The cell's name. If present, must be a non-empty string.", 
                 u'pattern': u'^.+$', 
                 u'type': u'string'}, 
            u'metadata_tags': {u'description': u"The cell's tags. Tags must be unique, and must not contain commas.", 
                 u'items': {u'pattern': u'^[^,]+$', 
                    u'type': u'string'}, 
                 u'type': u'array', 
                 u'uniqueItems': True}, 
            u'mimetype': {u'patternProperties': {u'^[a-zA-Z0-9\\-\\+]+/[a-zA-Z0-9\\-\\+]+': {u'$ref': u'#/definitions/misc/multiline_string', 
                                u'description': u"The cell's mimetype output (e.g. text/plain), represented as either an array of strings or a string."}}}, 
            u'multiline_string': {u'oneOf': [{u'type': u'string'}, 
                    {u'items': {u'type': u'string'}, 
                     u'type': u'array'}]}, 
            u'output_metadata': {u'additionalProperties': True, 
                 u'description': u'Cell output metadata.', 
                 u'type': u'object'}, 
            u'prompt_number': {u'description': u"The code cell's prompt number. Will be null if the cell has not been run.", 
                 u'minimum': 0, 
                 u'type': [u'integer', 
                   u'null']}, 
            u'source': {u'$ref': u'#/definitions/misc/multiline_string', 
               u'description': u'Contents of the cell, represented as an array of lines.'}}, 
          u'output': {u'oneOf': [{u'$ref': u'#/definitions/pyout'}, 
               {u'$ref': u'#/definitions/display_data'}, 
               {u'$ref': u'#/definitions/stream'}, 
               {u'$ref': u'#/definitions/pyerr'}], 
             u'type': u'object'}, 
          u'pyerr': {u'additionalProperties': False, 
            u'description': u'Output of an error that occurred during code cell execution.', 
            u'properties': {u'ename': {u'description': u'The name of the error.', 
                   u'type': u'string'}, 
                u'evalue': {u'description': u'The value, or message, of the error.', 
                   u'type': u'string'}, 
                u'output_type': {u'description': u'Type of cell output.', 
                     u'enum': [u'pyerr']}, 
                u'traceback': {u'description': u"The error's traceback, represented as an array of strings.", 
                    u'items': {u'type': u'string'}, 
                    u'type': u'array'}}, 
            u'required': [u'output_type', 
                u'ename', 
                u'evalue', 
                u'traceback'], 
            u'type': u'object'}, 
          u'pyout': {u'additionalProperties': False, 
            u'description': u'Result of executing a code cell.', 
            u'patternProperties': {u'^[a-zA-Z0-9]+/[a-zA-Z0-9\\-\\+\\.]+$': {u'$ref': u'#/definitions/misc/multiline_string', 
                             u'description': u'mimetype output (e.g. text/plain), represented as either an array of strings or a string.'}}, 
            u'properties': {u'html': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                u'javascript': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                u'jpeg': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                u'json': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                u'latex': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                u'metadata': {u'$ref': u'#/definitions/misc/output_metadata'}, 
                u'output_type': {u'description': u'Type of cell output.', 
                     u'enum': [u'pyout']}, 
                u'pdf': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                u'png': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                u'prompt_number': {u'description': u"A result's prompt number.", 
                     u'minimum': 0, 
                     u'type': [u'integer']}, 
                u'svg': {u'$ref': u'#/definitions/misc/multiline_string'}, 
                u'text': {u'$ref': u'#/definitions/misc/multiline_string'}}, 
            u'required': [u'output_type', 
                u'prompt_number'], 
            u'type': u'object'}, 
          u'raw_cell': {u'additionalProperties': False, 
             u'description': u'Notebook raw nbconvert cell.', 
             u'properties': {u'cell_type': {u'description': u'String identifying the type of cell.', 
                     u'enum': [u'raw']}, 
                 u'metadata': {u'additionalProperties': True, 
                     u'description': u'Cell-level metadata.', 
                     u'properties': {u'format': {u'description': u'Raw cell metadata format for nbconvert.', 
                            u'type': u'string'}, 
                         u'name': {u'$ref': u'#/definitions/misc/metadata_name'}, 
                         u'tags': {u'$ref': u'#/definitions/misc/metadata_tags'}}, 
                     u'type': u'object'}, 
                 u'source': {u'$ref': u'#/definitions/misc/source'}}, 
             u'required': [u'cell_type', 
                 u'source'], 
             u'type': u'object'}, 
          u'stream': {u'additionalProperties': False, 
             u'description': u'Stream output from a code cell.', 
             u'properties': {u'output_type': {u'description': u'Type of cell output.', 
                     u'enum': [u'stream']}, 
                 u'stream': {u'description': u'The stream type/destination.', 
                    u'type': u'string'}, 
                 u'text': {u'$ref': u'#/definitions/misc/multiline_string', 
                   u'description': u"The stream's text output, represented as an array of strings."}}, 
             u'required': [u'output_type', 
                u'stream', 
                u'text'], 
             u'type': u'object'}, 
          u'worksheet': {u'additionalProperties': False, 
             u'properties': {u'cells': {u'description': u'Array of cells of the current notebook.', 
                    u'items': {u'oneOf': [{u'$ref': u'#/definitions/raw_cell'}, 
                          {u'$ref': u'#/definitions/markdown_cell'}, 
                          {u'$ref': u'#/definitions/heading_cell'}, 
                          {u'$ref': u'#/definitions/code_cell'}], 
                       u'type': u'object'}, 
                    u'type': u'array'}, 
                 u'metadata': {u'description': u'metadata of the current worksheet', 
                     u'type': u'object'}}, 
             u'required': [u'cells']}}, 
     u'description': u'IPython Notebook v3.0 JSON schema.', 
     u'properties': {u'metadata': {u'additionalProperties': True, 
             u'description': u'Notebook root-level metadata.', 
             u'properties': {u'kernel_info': {u'description': u'Kernel information.', 
                     u'properties': {u'codemirror_mode': {u'description': u'The codemirror mode to use for code in this language.', 
                              u'type': u'string'}, 
                         u'language': {u'description': u'The programming language which this kernel runs.', 
                             u'type': u'string'}, 
                         u'name': {u'description': u'Name of the kernel specification.', 
                            u'type': u'string'}}, 
                     u'required': [u'name', 
                         u'language'], 
                     u'type': u'object'}, 
                 u'signature': {u'description': u'Hash of the notebook.', 
                     u'type': u'string'}}, 
             u'type': u'object'}, 
         u'nbformat': {u'description': u'Notebook format (major number). Incremented between backwards incompatible changes to the notebook format.', 
             u'maximum': 3, 
             u'minimum': 3, 
             u'type': u'integer'}, 
         u'nbformat_minor': {u'description': u'Notebook format (minor number). Incremented for backward compatible changes to the notebook format.', 
              u'minimum': 0, 
              u'type': u'integer'}, 
         u'orig_nbformat': {u'description': u'Original notebook format (major number) before converting the notebook between versions.', 
              u'minimum': 1, 
              u'type': u'integer'}, 
         u'orig_nbformat_minor': {u'description': u'Original notebook format (minor number) before converting the notebook between versions.', 
                u'minimum': 0, 
                u'type': u'integer'}, 
         u'worksheets': {u'description': u'Array of worksheets', 
             u'items': {u'$ref': u'#/definitions/worksheet'}, 
             u'type': u'array'}}, 
     u'required': [u'metadata', 
         u'nbformat_minor', 
         u'nbformat', 
         u'worksheets'], 
     u'type': u'object'} 

    On instance: 
     {u'cells': [], 
     u'metadata': {}, 
     u'nbformat': 3, 
     u'nbformat_minor': 0, 
     u'worksheets': [{u'cells': [{u'cell_type': u'code', 
             u'execution_count': None, 
             u'input': u'%matplotlib inline', 
             u'language': u'python', 
             u'metadata': {}, 
             u'outputs': []}, 
            {u'cell_type': u'code', 
             u'execution_count': None, 
             u'input': u'', 
             u'language': u'python', 
             u'metadata': {}, 
             u'outputs': []}, 
            {u'cell_type': u'code', 
             u'execution_count': None, 
             u'input': u'', 
             u'language': u'python', 
             u'metadata': {}, 
             u'outputs': []}]}]} 
[W 21:25:30.393 NotebookApp] Notebook test.ipynb is not trusted 

Pycharm में

/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /usr/local/bin/ipython notebook --no-browser --ip localhost --port 8889 
[I 21:18:54.055 NotebookApp] Serving notebooks from local directory: /Users/yangyy/GitHub/Signal&System 
[I 21:18:54.055 NotebookApp] 0 active kernels 
[I 21:18:54.055 NotebookApp] The IPython Notebook is running at: http://localhost:8889/ 
[I 21:18:54.056 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). 
[W 21:18:56.558 NotebookApp] 404 GET /api (127.0.0.1) 27.47ms referer=None 
[I 21:18:56.589 NotebookApp] Kernel started: 2ff0bf8f-4351-4423-a867-23a698f4b820 
[W 21:18:56.594 NotebookApp] 404 GET /api/kernels/2ff0bf8f-4351-4423-a867-23a698f4b820/iopub (127.0.0.1) 1.52ms referer=None 
[W 21:18:56.596 NotebookApp] 404 GET /api/kernels/2ff0bf8f-4351-4423-a867-23a698f4b820/shell (127.0.0.1) 1.16ms referer=None 
[W 21:18:56.690 NotebookApp] 404 GET /api (127.0.0.1) 2.05ms referer=None 
[I 21:18:56.703 NotebookApp] Kernel started: d1e16c68-352d-4d1a-89ed-9548a666f9ab 
[W 21:18:56.712 NotebookApp] 404 GET /api/kernels/d1e16c68-352d-4d1a-89ed-9548a666f9ab/shell (127.0.0.1) 2.61ms referer=None 
[W 21:18:56.715 NotebookApp] 404 GET /api/kernels/d1e16c68-352d-4d1a-89ed-9548a666f9ab/iopub (127.0.0.1) 1.78ms referer=None 
[I 21:20:29.566 NotebookApp] Kernel restarted: d1e16c68-352d-4d1a-89ed-9548a666f9ab 
[W 21:20:38.117 NotebookApp] 404 GET /api (127.0.0.1) 2.99ms referer=None 
[I 21:20:38.132 NotebookApp] Kernel started: 792636bb-8fda-4d26-9f4f-c92a799ef23c 
[W 21:20:38.138 NotebookApp] 404 GET /api/kernels/792636bb-8fda-4d26-9f4f-c92a799ef23c/shell (127.0.0.1) 2.28ms referer=None 
[W 21:20:38.140 NotebookApp] 404 GET /api/kernels/792636bb-8fda-4d26-9f4f-c92a799ef23c/iopub (127.0.0.1) 1.26ms referer=None 

हालात ठीक है जब मैं ब्राउज़र enter image description here

किसी को भी एक ही समस्या में पड़ रहा है का उपयोग कर रहे हैं?

+0

1) matplotlib स्थापित है? 2) क्या आपकी परियोजनाओं के पथ में matplotlib है? 3) क्या यह नोटबुक के पथ में है? 3) क्या आपको नोटबुक चलाने पर वही परिणाम मिलते हैं? –

+0

'matplotlib' प्रणाली को चौड़ा स्थापित किया गया है और प्रोजेक्ट का दुभाषिया सिस्टम एक है। जब मैं ब्राउज़र में इसका उपयोग करता हूं तो iPython नोटबुक ठीक काम करता है। लेकिन मुझे समझ में नहीं आता कि 'नोटबुक के पथ' में क्या मतलब है? –

+0

मुझे पता चला कि ऐसा इसलिए है क्योंकि पिचर्म 'आईपीथॉन 4.2.0' के नए एपीआई को नहीं पहचानता है और मुझे बस नवीनतम संस्करण आईपीथन को अनइंस्टॉल करने और 'आईपीथॉन 3.2.3' इंस्टॉल करने की आवश्यकता है। –

उत्तर

2

मैंने पाया है कि इसकी वजह Pycharm IPython 4.2.0 के नए एपीआई को नहीं पहचानता है और मैं बस नवीनतम संस्करण IPython की स्थापना रद्द करने की जरूरत है और IPython 3.2.3 स्थापित करें।

भागो

$ pip uninstall IPython 
$ pip install 'ipython<4' 
टर्मिनल में

और sudo का उपयोग करता है, तो अनुमति नहीं दी।

+0

ठीक है, मैंने इस समाधान की कोशिश की लेकिन यह मेरे लिए काम नहीं किया। मैं PyCharm सामुदायिक संस्करण 2016.2.3 का उपयोग कर रहा हूँ। मैं आईपीथन 5.3.0 का उपयोग कर रहा था और इसे 'कोंडा हटाने आईपीथॉन' के साथ अनइंस्टॉल किया (मैं एनाकोंडा 2 का उपयोग कर रहा हूं)। फिर मैंने 'कोंडा इंस्टॉल' ipython <4'' के साथ आईपीथन 3.2.3 स्थापित किया। नोटबुक का उपयोग करने का प्रयास किया और कुछ भी फिर से भाग गया। तब मैंने 'कोंडा इंस्टॉल जुपीटर' की कोशिश की लेकिन इसे नवीनतम संस्करण में आईपीथॉन अपडेट करने की आवश्यकता थी। '--no-update-dependencies' विकल्प' के साथ भी, IPython को अपडेट किए बिना jupyter इंस्टॉल नहीं किया जा सका। –

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