Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行script/run.py时出报了找不到thostmduserapi_se的错 #53

Closed
kyugao opened this issue Mar 27, 2024 · 18 comments
Closed

运行script/run.py时出报了找不到thostmduserapi_se的错 #53

kyugao opened this issue Mar 27, 2024 · 18 comments

Comments

@kyugao
Copy link

kyugao commented Mar 27, 2024

看到刚刚的提交,是不是现在在mac下支持ctp了?

下载了最新版的代码:使用pip install .安装

site-package下的结构如图
image

完整的报错信息:

Traceback (most recent call last):
  File "/Users/gao/Workspace/python_home/vnpy_ctp/script/run.py", line 5, in <module>
    from vnpy_ctp import CtpGateway
  File "/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/vnpy_ctp/__init__.py", line 26, in <module>
    from .gateway import CtpGateway
  File "/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/vnpy_ctp/gateway/__init__.py", line 1, in <module>
    from .ctp_gateway import CtpGateway
  File "/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/vnpy_ctp/gateway/ctp_gateway.py", line 31, in <module>
    from ..api import (
  File "/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/vnpy_ctp/api/__init__.py", line 1, in <module>
    from .vnctpmd import MdApi
ImportError: dlopen(/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/vnpy_ctp/api/vnctpmd.cpython-310-darwin.so, 0x0002): Library not loaded: @rpath/thostmduserapi_se.framework/Versions/A/thostmduserapi_se
  Referenced from: <BED264D0-13AA-3CBC-8FA3-A023EB75E154> /opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/vnpy_ctp/api/vnctpmd.cpython-310-darwin.so
  Reason: tried: '/Users/cxy/GitHub/vnpy_ctp/vnpy_ctp/api/thostmduserapi_se.framework/Versions/A/thostmduserapi_se' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/cxy/GitHub/vnpy_ctp/vnpy_ctp/api/thostmduserapi_se.framework/Versions/A/thostmduserapi_se' (no such file), '/Users/cxy/GitHub/vnpy_ctp/vnpy_ctp/api/thostmduserapi_se.framework/Versions/A/thostmduserapi_se' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/cxy/GitHub/vnpy_ctp/vnpy_ctp/api/thostmduserapi_se.framework/Versions/A/thostmduserapi_se' (no such file), '/opt/anaconda3/envs/vnpy_env_310/bin/../lib/thostmduserapi_se.framework/Versions/A/thostmduserapi_se' (code signature invalid in <C6A402BB-AF53-352E-A2C2-2BCF56D402BC> '/opt/anaconda3/envs/vnpy_env_310/lib/thostmduserapi_se.framework/Versions/A/thostmduserapi_se' (errno=1) sliceOffset=0x00434000, codeBlobOffset=0x003849D0, codeBlobSize=0x0000B8C0), '/opt/anaconda3/envs/vnpy_env_310/bin/../lib/thostmduserapi_se.framework/Versions/A/thostmduserapi_se' (code signature invalid in <C6A402BB-AF53-352E-A2C2-2BCF56D402BC> '/opt/anaconda3/envs/vnpy_env_310/lib/thostmduserapi_se.framework/Versions/A/thostmduserapi_se' (errno=1) sliceOffset=0x00434000, codeBlobOffset=0x003849D0, codeBlobSize=0x0000B8C0), '/Library/Frameworks/thostmduserapi_se.framework/Versions/A/thostmduserapi_se' (no such file), '/System/Library/Frameworks/thostmduserapi_se.framework/Versions/A/thostmduserapi_se' (no such file, not in dyld cache)
@vnpy
Copy link
Owner

vnpy commented Mar 28, 2024

确认了下,这里应该是由于wheel二进制安装包,其中动态库的搜索路径绑定了我们编译机环境导致的问题。

请先确保机器上安装了XCode编译工具,然后试试这样解决:

  1. pip uninstall vnpy_ctp卸载
  2. git clone当前最新的6.7.2版本(master分支到本地)
  3. 运行命令执行编译:python setup.py build
  4. 然后再运行命令执行安装:pip install .

@kyugao
Copy link
Author

kyugao commented Mar 28, 2024

版本已经确认是最新的了
image

build的时候报了一些错误

(vnpy_env_310) gao@Adams-MacBook-Pro vnpy_ctp % python setup.py build running build running build_py running egg_info writing vnpy_ctp.egg-info/PKG-INFO writing dependency_links to vnpy_ctp.egg-info/dependency_links.txt writing requirements to vnpy_ctp.egg-info/requires.txt writing top-level names to vnpy_ctp.egg-info/top_level.txt reading manifest file 'vnpy_ctp.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '*.pyd' under directory 'vnpy_ctp' adding license file 'LICENSE' writing manifest file 'vnpy_ctp.egg-info/SOURCES.txt' /opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'vnpy_ctp.api.generator' is absent from thepackages` configuration.
!!

    ********************************************************************************
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'vnpy_ctp.api.generator' as an importable package[^1],
    but it is absent from setuptools' `packages` configuration.

    This leads to an ambiguous overall configuration. If you want to distribute this
    package, please make sure that 'vnpy_ctp.api.generator' is explicitly added
    to the `packages` configuration field.

    Alternatively, you can also rely on setuptools' discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

    If you don't want 'vnpy_ctp.api.generator' to be distributed and are
    already explicitly excluding 'vnpy_ctp.api.generator' via
    `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
    you can try to use `exclude_package_data`, or `include-package-data=False` in
    combination with a more fine grained `package-data` configuration.

    You can read more about "package data files" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


    [^1]: For Python, any directory (with suitable naming) can be imported,
          even if it does not contain any `.py` files.
          On the other hand, currently there is no concept of package data
          directory, all directories are treated like packages.
    ********************************************************************************

!!
check.warn(importable)
/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'vnpy_ctp.api.include.ctp' is absent from the packages configuration.
!!

    ********************************************************************************
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'vnpy_ctp.api.include.ctp' as an importable package[^1],
    but it is absent from setuptools' `packages` configuration.

    This leads to an ambiguous overall configuration. If you want to distribute this
    package, please make sure that 'vnpy_ctp.api.include.ctp' is explicitly added
    to the `packages` configuration field.

    Alternatively, you can also rely on setuptools' discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

    If you don't want 'vnpy_ctp.api.include.ctp' to be distributed and are
    already explicitly excluding 'vnpy_ctp.api.include.ctp' via
    `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
    you can try to use `exclude_package_data`, or `include-package-data=False` in
    combination with a more fine grained `package-data` configuration.

    You can read more about "package data files" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


    [^1]: For Python, any directory (with suitable naming) can be imported,
          even if it does not contain any `.py` files.
          On the other hand, currently there is no concept of package data
          directory, all directories are treated like packages.
    ********************************************************************************

!!
check.warn(importable)
/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'vnpy_ctp.api.include.pybind11' is absent from the packages configuration.
!!

    ********************************************************************************
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'vnpy_ctp.api.include.pybind11' as an importable package[^1],
    but it is absent from setuptools' `packages` configuration.

    This leads to an ambiguous overall configuration. If you want to distribute this
    package, please make sure that 'vnpy_ctp.api.include.pybind11' is explicitly added
    to the `packages` configuration field.

    Alternatively, you can also rely on setuptools' discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

    If you don't want 'vnpy_ctp.api.include.pybind11' to be distributed and are
    already explicitly excluding 'vnpy_ctp.api.include.pybind11' via
    `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
    you can try to use `exclude_package_data`, or `include-package-data=False` in
    combination with a more fine grained `package-data` configuration.

    You can read more about "package data files" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


    [^1]: For Python, any directory (with suitable naming) can be imported,
          even if it does not contain any `.py` files.
          On the other hand, currently there is no concept of package data
          directory, all directories are treated like packages.
    ********************************************************************************

!!
check.warn(importable)
/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'vnpy_ctp.api.include.pybind11.detail' is absent from the packages configuration.
!!

    ********************************************************************************
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'vnpy_ctp.api.include.pybind11.detail' as an importable package[^1],
    but it is absent from setuptools' `packages` configuration.

    This leads to an ambiguous overall configuration. If you want to distribute this
    package, please make sure that 'vnpy_ctp.api.include.pybind11.detail' is explicitly added
    to the `packages` configuration field.

    Alternatively, you can also rely on setuptools' discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

    If you don't want 'vnpy_ctp.api.include.pybind11.detail' to be distributed and are
    already explicitly excluding 'vnpy_ctp.api.include.pybind11.detail' via
    `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
    you can try to use `exclude_package_data`, or `include-package-data=False` in
    combination with a more fine grained `package-data` configuration.

    You can read more about "package data files" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


    [^1]: For Python, any directory (with suitable naming) can be imported,
          even if it does not contain any `.py` files.
          On the other hand, currently there is no concept of package data
          directory, all directories are treated like packages.
    ********************************************************************************

!!
check.warn(importable)
/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'vnpy_ctp.api.include.pybind11.eigen' is absent from the packages configuration.
!!

    ********************************************************************************
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'vnpy_ctp.api.include.pybind11.eigen' as an importable package[^1],
    but it is absent from setuptools' `packages` configuration.

    This leads to an ambiguous overall configuration. If you want to distribute this
    package, please make sure that 'vnpy_ctp.api.include.pybind11.eigen' is explicitly added
    to the `packages` configuration field.

    Alternatively, you can also rely on setuptools' discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

    If you don't want 'vnpy_ctp.api.include.pybind11.eigen' to be distributed and are
    already explicitly excluding 'vnpy_ctp.api.include.pybind11.eigen' via
    `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
    you can try to use `exclude_package_data`, or `include-package-data=False` in
    combination with a more fine grained `package-data` configuration.

    You can read more about "package data files" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


    [^1]: For Python, any directory (with suitable naming) can be imported,
          even if it does not contain any `.py` files.
          On the other hand, currently there is no concept of package data
          directory, all directories are treated like packages.
    ********************************************************************************

!!
check.warn(importable)
/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'vnpy_ctp.api.include.pybind11.stl' is absent from the packages configuration.
!!

    ********************************************************************************
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'vnpy_ctp.api.include.pybind11.stl' as an importable package[^1],
    but it is absent from setuptools' `packages` configuration.

    This leads to an ambiguous overall configuration. If you want to distribute this
    package, please make sure that 'vnpy_ctp.api.include.pybind11.stl' is explicitly added
    to the `packages` configuration field.

    Alternatively, you can also rely on setuptools' discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

    If you don't want 'vnpy_ctp.api.include.pybind11.stl' to be distributed and are
    already explicitly excluding 'vnpy_ctp.api.include.pybind11.stl' via
    `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
    you can try to use `exclude_package_data`, or `include-package-data=False` in
    combination with a more fine grained `package-data` configuration.

    You can read more about "package data files" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


    [^1]: For Python, any directory (with suitable naming) can be imported,
          even if it does not contain any `.py` files.
          On the other hand, currently there is no concept of package data
          directory, all directories are treated like packages.
    ********************************************************************************

!!
check.warn(importable)
/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'vnpy_ctp.api.libs' is absent from the packages configuration.
!!

    ********************************************************************************
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'vnpy_ctp.api.libs' as an importable package[^1],
    but it is absent from setuptools' `packages` configuration.

    This leads to an ambiguous overall configuration. If you want to distribute this
    package, please make sure that 'vnpy_ctp.api.libs' is explicitly added
    to the `packages` configuration field.

    Alternatively, you can also rely on setuptools' discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

    If you don't want 'vnpy_ctp.api.libs' to be distributed and are
    already explicitly excluding 'vnpy_ctp.api.libs' via
    `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
    you can try to use `exclude_package_data`, or `include-package-data=False` in
    combination with a more fine grained `package-data` configuration.

    You can read more about "package data files" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


    [^1]: For Python, any directory (with suitable naming) can be imported,
          even if it does not contain any `.py` files.
          On the other hand, currently there is no concept of package data
          directory, all directories are treated like packages.
    ********************************************************************************

!!
check.warn(importable)
/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'vnpy_ctp.api.vnctp' is absent from the packages configuration.
!!

    ********************************************************************************
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'vnpy_ctp.api.vnctp' as an importable package[^1],
    but it is absent from setuptools' `packages` configuration.

    This leads to an ambiguous overall configuration. If you want to distribute this
    package, please make sure that 'vnpy_ctp.api.vnctp' is explicitly added
    to the `packages` configuration field.

    Alternatively, you can also rely on setuptools' discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

    If you don't want 'vnpy_ctp.api.vnctp' to be distributed and are
    already explicitly excluding 'vnpy_ctp.api.vnctp' via
    `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
    you can try to use `exclude_package_data`, or `include-package-data=False` in
    combination with a more fine grained `package-data` configuration.

    You can read more about "package data files" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


    [^1]: For Python, any directory (with suitable naming) can be imported,
          even if it does not contain any `.py` files.
          On the other hand, currently there is no concept of package data
          directory, all directories are treated like packages.
    ********************************************************************************

!!
check.warn(importable)
/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'vnpy_ctp.api.vnctp.vnctpmd' is absent from the packages configuration.
!!

    ********************************************************************************
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'vnpy_ctp.api.vnctp.vnctpmd' as an importable package[^1],
    but it is absent from setuptools' `packages` configuration.

    This leads to an ambiguous overall configuration. If you want to distribute this
    package, please make sure that 'vnpy_ctp.api.vnctp.vnctpmd' is explicitly added
    to the `packages` configuration field.

    Alternatively, you can also rely on setuptools' discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

    If you don't want 'vnpy_ctp.api.vnctp.vnctpmd' to be distributed and are
    already explicitly excluding 'vnpy_ctp.api.vnctp.vnctpmd' via
    `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
    you can try to use `exclude_package_data`, or `include-package-data=False` in
    combination with a more fine grained `package-data` configuration.

    You can read more about "package data files" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


    [^1]: For Python, any directory (with suitable naming) can be imported,
          even if it does not contain any `.py` files.
          On the other hand, currently there is no concept of package data
          directory, all directories are treated like packages.
    ********************************************************************************

!!
check.warn(importable)
/opt/anaconda3/envs/vnpy_env_310/lib/python3.10/site-packages/setuptools/command/build_py.py:204: _Warning: Package 'vnpy_ctp.api.vnctp.vnctptd' is absent from the packages configuration.
!!

    ********************************************************************************
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'vnpy_ctp.api.vnctp.vnctptd' as an importable package[^1],
    but it is absent from setuptools' `packages` configuration.

    This leads to an ambiguous overall configuration. If you want to distribute this
    package, please make sure that 'vnpy_ctp.api.vnctp.vnctptd' is explicitly added
    to the `packages` configuration field.

    Alternatively, you can also rely on setuptools' discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

    If you don't want 'vnpy_ctp.api.vnctp.vnctptd' to be distributed and are
    already explicitly excluding 'vnpy_ctp.api.vnctp.vnctptd' via
    `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
    you can try to use `exclude_package_data`, or `include-package-data=False` in
    combination with a more fine grained `package-data` configuration.

    You can read more about "package data files" on setuptools documentation page:

    - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


    [^1]: For Python, any directory (with suitable naming) can be imported,
          even if it does not contain any `.py` files.
          On the other hand, currently there is no concept of package data
          directory, all directories are treated like packages.
    ********************************************************************************

!!
check.warn(importable)
running build_ext
`

@vnpy
Copy link
Owner

vnpy commented Mar 28, 2024

vnpy_ctp目录下如果有dist/build文件夹,需要手动先删除,再运行build试试

@kyugao
Copy link
Author

kyugao commented Apr 1, 2024

这个也试过删掉,还是找不到

@charlesliup
Copy link

同mac 14.4.1,vnpy-ctp-6.7.2.0,Python 3.10.14,按上面步骤操作,还是报同样的错

@zevichen
Copy link

zevichen commented Apr 7, 2024

1712501686453

这个路径有问题吗,我直接用master代码运行也是一样的问题。

@vnpy
Copy link
Owner

vnpy commented Apr 8, 2024

有点出乎意料,用Mac跑VeighNa的人这么多。

因为技术架构的关系和Linux/Windows使用有不少区别,后面要不专门组织一次社区活动交流?

@candy-Tong
Copy link

candy-Tong commented Apr 8, 2024

M2 的机器也需要 xcode 吗?文档里提到不需要,但我也没跑成功

@iuhiyuh
Copy link

iuhiyuh commented Apr 9, 2024

同不行

@zhtangsh
Copy link

同无法使用...

@ymdreaming
Copy link

同无法使用

@vnpy
Copy link
Owner

vnpy commented Apr 18, 2024

已经完成6.7.2的Mac问题修复,安装流程有所变化,具体请参考README.md

https://github.com/vnpy/vnpy_ctp

另外建了一个Mac用户的微信讨论群,方便后续这块的交流:

image

二维码7天内有效,有兴趣的同学可以赶紧加下。

@vnpy vnpy closed this as completed Apr 18, 2024
@jaytonteng
Copy link

群还能加吗? mac用户有问题

@vnpy
Copy link
Owner

vnpy commented Jun 5, 2024

image

这里是新的二维码

@kyugao
Copy link
Author

kyugao commented Jun 25, 2024

求一个新加群码

@vnpy
Copy link
Owner

vnpy commented Jun 25, 2024

image

@xucongyong
Copy link

求一个新加群码

@vnpy
Copy link
Owner

vnpy commented Sep 3, 2024

求一个新加群码

github.com/vnpy/vnpy主仓库中有

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants