如何正确安装lumibot?

问题描述 投票:0回答:1

我正在努力为我想放在简历中的股票交易机器人应用程序安装 lumibot。你们中的任何人是否有机会了解如何去做这件事?下面我附上了我遇到的所有问题的屏幕截图。

-- Logging error ---
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/utils/logging.py", line 177, in emit
    self.console.print(renderable, overflow="ignore", crop=False, style=style)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/rich/console.py", line 1673, in print
    extend(render(renderable, render_options))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/rich/console.py", line 1305, in render
    for render_output in iter_render:
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/utils/logging.py", line 134, in __rich_console__
    for line in lines:
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/rich/segment.py", line 249, in split_lines
    for segment in segments:
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/rich/console.py", line 1283, in render
    renderable = rich_cast(renderable)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/rich/protocol.py", line 36, in rich_cast
    renderable = cast_method()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/self_outdated_check.py", line 130, in __rich__
    pip_cmd = get_best_invocation_for_this_pip()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/utils/entrypoints.py", line 58, in get_best_invocation_for_this_pip
    if found_executable and os.path.samefile(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/genericpath.py", line 101, in samefile
    s2 = os.stat(f2)
FileNotFoundError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.10/bin/pip'
Call stack:
  File "/Library/Frameworks/Python.framework/Versions/3.11/bin/pip", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/cli/main.py", line 70, in main
    return command.main(cmd_args)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 101, in main
    return self._main(args)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 223, in _main
    self.handle_pip_version_check(options)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 190, in handle_pip_version_check
    pip_self_version_check(session, options)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/self_outdated_check.py", line 236, in pip_self_version_check
    logger.warning("[present-rich] %s", upgrade_prompt)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 1489, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 1624, in _log
    self.handle(record)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 1634, in handle
    self.callHandlers(record)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 1696, in callHandlers
    hdlr.handle(record)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 968, in handle
    self.emit(record)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_internal/utils/logging.py", line 179, in emit
    self.handleError(record)
Message: '[present-rich] %s'

这是我运行“pip install lumibot”后收到的输出。我读到lumibot只能使用Python 3.10,但我坚持使用Python 3.11。由于某种原因我无法更改它,我尝试从“应用程序”文件夹中卸载 3.10(因为我使用的是 MacOS),但这不起作用。当我运行“python --version”时,我仍然得到“Python 3.11.3”。

但是我要说的是,在出现上述错误之前,我收到了很多这样的消息:

Requirement already satisfied: click>=8.1.3 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from Flask->flask-marshmallow->lumibot) (8.1.5)
Requirement already satisfied: blinker>=1.6.2 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from Flask->flask-marshmallow->lumibot) (1.6.2)
Requirement already satisfied: Babel>=1.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from Flask-BabelEx>=0.9.3->flask-security->lumibot) (2.12.1)
Requirement already satisfied: speaklater>=1.2 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from Flask-BabelEx>=0.9.3->flask-security->lumibot) (1.3)
Requirement already satisfied: WTForms in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from Flask-WTF>=0.13.1->flask-security->lumibot) (3.0.1)
Requirement already satisfied: webencodings in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from html5lib>=1.1->yfinance>=0.2.18->lumibot) (0.5.1)
Requirement already satisfied: python-engineio>=4.3.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from python-socketio>=5.0.2->flask-socketio->lumibot) (4.5.1)
Requirement already satisfied: bidict>=0.21.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from python-socketio>=5.0.2->flask-socketio->lumibot) (0.22.1)
Requirement already satisfied: pycparser in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from cffi>=1.12->cryptography>=2.6.1->ccxt==3.0.61->lumibot) (2.21)
Requirement already satisfied: anyio<5.0,>=3.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from httpcore>=0.17.3->dnspython>=2.0.0->email-validator->lumibot) (3.7.1)
Requirement already satisfied: h11<0.15,>=0.13 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from httpcore>=0.17.3->dnspython>=2.0.0->email-validator->lumibot) (0.14.0)
Requirement already satisfied: MarkupSafe>=2.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from Jinja2>=3.1.2->Flask->flask-marshmallow->lumibot) (2.1.3)

当我运行“pip install lumibot”时,再次出现此输出。所以,似乎其中一些正在安装,但仍在 VS Code 中,当我尝试使用 lumibot 时,出现以下错误:

Import lumibot could not be resolved (Pylance)

一旦我解决了这个问题,我就可以正确开始我的交易项目,并最终完成我的应用程序简历,所以如果有人可以提供帮助,我将不胜感激!

总之,我尝试安装lumibot,但由于某种原因,它是我的计算机无法识别的唯一模块。 Pandas 可以工作,alpaca-py 可以工作,quantstats 可以工作,requests 可以工作。但 lumibot 仍然没有!

最初,我遇到了“aohttp”错误或类似的错误,但我设法在线阅读以找到一些过去的命令。当我运行一个在网上找到的命令来安装它时,我以为我已经回家了,因为我没有收到任何错误,并且我重新启动了计算机几次以反映我对 pip 和 Python 版本所做的升级。但仍然没有雪茄。

python pip trading algorithmic-trading pylance
1个回答
0
投票

尝试 pip3 install lumibot 应该可以工作。

© www.soinside.com 2019 - 2024. All rights reserved.