向 jupyter notebook 添加软件包-特别是物理软件包

向 jupyter notebook 添加软件包-特别是物理软件包

我正在使用 jupyter notebook,用 latex 写一些作业。最近,我在尝试从量子力学(bra、ket)中写入符号时遇到了一个问题。

当我在 markdown 单元格中写入以下内容时:$\bar{\psi}$ 。它无法识别 \bra。我想我应该为此安装一些包,但我不知道如何去做。

最终我找到了这个地点有关为 jupyter notebook 安装一些乳胶环境的说明,但我不确定它是否包含物理包,而且我实际上未能安装它。

这是输入时终端的读数

 pip3 install jupyter_latex_envs [--user][--upgrade]

ERROR: Exception:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py", line 1828, in parseString
    raise exc
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py", line 1818, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py", line 1562, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py", line 3752, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py", line 1566, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py", line 3536, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 11), (line:1, col:12)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 178, in main
    status = self.run(options, args)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 326, in run
    self.name, wheel_cache
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 268, in populate_requirement_set
    wheel_cache=wheel_cache
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/req/constructors.py", line 280, in install_req_from_line
    extras = Requirement("placeholder" + extras_as_string.lower()).extras
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__
    requirement_string[e.loc : e.loc + 8], e.msg
pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'[--upgra'": Expected stringEnd

这是我尝试通过 pip 安装后出现的错误。

所以底线是,我想学习如何将物理乳胶包加载到 jupyter 笔记本中,如果我当前的尝试确实是好的,那么我想学习如何传递当前的安装错误。

  • 我正在使用 macos

相关内容