【问题标题】:Invalid syntax in opening functions module打开函数模块中的语法无效
【发布时间】:2020-05-04 14:37:32
【问题描述】:

当我运行我的代码时,出现语法错误,我不知道为什么。当然我成功安装了 Functions 模块,但是出现了这个错误。

%pylab inline
%matplotlib notebook

rcParams["figure.figsize"]=12,8
from functions import circles,deposit_particles,create_envelope,create_envelope_selected
from ipywidgets import interact
from ipywidgets.widgets import IntSlider,IntText,Label,VBox,HBox,Layout,Button,FloatSlider,ToggleButton,FloatText
from IPython.display import clear_output,display
'''

the error:
'''
Populating the interactive namespace from numpy and matplotlib
Traceback (most recent call last):

  File "C:\Users\Win 8.1\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3326, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-3-1f3efd9a314f>", line 10, in <module>
    from functions import circles,deposit_particles,create_envelope,create_envelope_selected

  File "C:\Users\Win 8.1\Anaconda3\lib\site-packages\functions.py", line 68
    nodes = tuple(map(lambda (k, v): process_node(inner, k, v),
                             ^
SyntaxError: invalid syntax

【问题讨论】:

标签: python


【解决方案1】:

只需修补 functions.py:更改所有 lambda (x, y) -> lambda x, y

来自https://github.com/getsentry/sentry/issues/6030

【讨论】:

  • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接答案可能会失效。 - From Review
猜你喜欢
  • 1970-01-01
  • 2021-06-24
  • 1970-01-01
  • 1970-01-01
  • 2020-07-13
  • 2021-06-09
  • 1970-01-01
  • 2022-12-06
  • 2021-11-08
相关资源
最近更新 更多