热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ModuleNotFoundError:Nomodulenamed'merlin.tradelogic'

如何解决《ModuleNotFoundError:Nomodulenamed'merlin.tradelogic'》经验,请问有没有懂的朋友?

I am having a problem with executing a script. I have a number of inherited scripts which I need to figure out how to run. Please see some background and the problem below:

The code has been transferred from an old environment (where the whole process runs fine) to a new environment. This is where the problems have started. Please see below for a cut down version of the file tree. It is a very large project so I can't post the entire tree, but hopefully this is the part that I need help with.

The uncompiled code tree:

??? dao
?   ??? cythonlib
?   ?   ??? cyrandom.c
?   ?   ??? cyrandom.cpython-35m-darwin.so
?   ?   ??? cyrandom.pxd
?   ?   ??? cyrandom.pyx
?   ?   ??? __init__.py
?   ?   ??? _random.pxd
?   ?   ??? src
?   ?       ??? _random.c
??? merlin
?   ??? cmdopt.py
?   ??? __init__.py
?   ??? instrument.py
?   ??? mktdata.py
?   ??? overview.py
?   ??? pair.py
?   ??? portfolio.py
?   ??? src
?   ?   ??? MerlinLogic.cpp
?   ?   ??? MerlinLogic.hpp
?   ??? stratconfig.py
?   ??? tradega.cpp
?   ??? tradega.cpython-35m-darwin.so
?   ??? tradega.pxd
?   ??? tradega.pyx
?   ??? tradelogic.cpp
?   ??? tradelogic.cpython-35m-darwin.so
?   ??? tradelogic.pxd
?   ??? tradelogic.pyx
?   ??? tradeopt.py
?   ??? utils.py
?   ??? var.py
?   ??? wrtconfig.py
??? merlin_cprofile.sh
??? merlin.py

The compiled tree:

strat
??? dao
?   ??? cythonlib
?   ?   ??? cyrandom.cpython-35m-x86_64-linux-gnu.so
?   ?   ??? __init__.pyc
??? merlin
?   ??? cmdopt.pyc
?   ??? __init__.pyc
?   ??? tradega.cpython-35m-x86_64-linux-gnu.so
?   ??? tradelogic.cpython-35m-x86_64-linux-gnu.so
?   ??? tradeopt.pyc
?   ??? utils.pyc
?   ??? var.pyc
?   ??? wrtconfig.pyc
??? merlin.pyc
??? merlin.sh

The merlin.pyc script is called and from there various other scripts in the merlin directory are executed.

Part of the way through the process I get the error:

Traceback (most recent call last):
  File "strats/merlin.py", line 13, in 
  File "strats/merlin/tradeopt.py", line 11, in 
ModuleNotFoundError: No module named 'merlin.tradelogic'

The new environment is running python version

[user@localhost mktdata.out]$ python --version
Python 2.7.15

Where as the old environment was running python version:

Python 3.5.3

In the new environment I am running gcc version:

[user@localhost mktdata.out]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 7.3.1 20180712 (Red Hat 7.3.1-6) (GCC)  

In the new environment I am running g++ version:

[user@localhost mktdata.out]$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 7.3.1 20180712 (Red Hat 7.3.1-6) (GCC) 

原谅我的无知,但我需要使用Python 2.7.15重新编译的问题tradelogic.cpython-35m-darwin.so,并tradega.cpython-35m-darwin.so让我的新环境,使用Python版本(2.7.15)可以读?如果正确,我需要编译tradelogic.cpptradega.cpp获取两个新.so文件吗?

如果不是这种情况,我该怎么做才能解决我的问题?


推荐阅读
  • 本文介绍了数据库的存储结构及其重要性,强调了关系数据库范例中将逻辑存储与物理存储分开的必要性。通过逻辑结构和物理结构的分离,可以实现对物理存储的重新组织和数据库的迁移,而应用程序不会察觉到任何更改。文章还展示了Oracle数据库的逻辑结构和物理结构,并介绍了表空间的概念和作用。 ... [详细]
  • 使用nodejs爬取b站番剧数据,计算最佳追番推荐
    本文介绍了如何使用nodejs爬取b站番剧数据,并通过计算得出最佳追番推荐。通过调用相关接口获取番剧数据和评分数据,以及使用相应的算法进行计算。该方法可以帮助用户找到适合自己的番剧进行观看。 ... [详细]
  • 本文介绍了使用kotlin实现动画效果的方法,包括上下移动、放大缩小、旋转等功能。通过代码示例演示了如何使用ObjectAnimator和AnimatorSet来实现动画效果,并提供了实现抖动效果的代码。同时还介绍了如何使用translationY和translationX来实现上下和左右移动的效果。最后还提供了一个anim_small.xml文件的代码示例,可以用来实现放大缩小的效果。 ... [详细]
  • 本文介绍了在Linux下安装Perl的步骤,并提供了一个简单的Perl程序示例。同时,还展示了运行该程序的结果。 ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
  • 在Xamarin XAML语言中如何在页面级别构建ControlTemplate控件模板
    本文介绍了在Xamarin XAML语言中如何在页面级别构建ControlTemplate控件模板的方法和步骤,包括将ResourceDictionary添加到页面中以及在ResourceDictionary中实现模板的构建。通过本文的阅读,读者可以了解到在Xamarin XAML语言中构建控件模板的具体操作步骤和语法形式。 ... [详细]
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • mac php错误日志配置方法及错误级别修改
    本文介绍了在mac环境下配置php错误日志的方法,包括修改php.ini文件和httpd.conf文件的操作步骤。同时还介绍了如何修改错误级别,以及相应的错误级别参考链接。 ... [详细]
  • 模板引擎StringTemplate的使用方法和特点
    本文介绍了模板引擎StringTemplate的使用方法和特点,包括强制Model和View的分离、Lazy-Evaluation、Recursive enable等。同时,还介绍了StringTemplate语法中的属性和普通字符的使用方法,并提供了向模板填充属性的示例代码。 ... [详细]
  • Whatsthedifferencebetweento_aandto_ary?to_a和to_ary有什么区别? ... [详细]
  • 欢乐的票圈重构之旅——RecyclerView的头尾布局增加
    项目重构的Git地址:https:github.comrazerdpFriendCircletreemain-dev项目同步更新的文集:http:www.jianshu.comno ... [详细]
  • Hibernate延迟加载深入分析-集合属性的延迟加载策略
    本文深入分析了Hibernate延迟加载的机制,特别是集合属性的延迟加载策略。通过延迟加载,可以降低系统的内存开销,提高Hibernate的运行性能。对于集合属性,推荐使用延迟加载策略,即在系统需要使用集合属性时才从数据库装载关联的数据,避免一次加载所有集合属性导致性能下降。 ... [详细]
  • HashMap的扩容知识详解
    本文详细介绍了HashMap的扩容知识,包括扩容的概述、扩容条件以及1.7版本中的扩容方法。通过学习本文,读者可以全面了解HashMap的扩容机制,提升对HashMap的理解和应用能力。 ... [详细]
  • 本文介绍了一个适用于PHP应用快速接入TRX和TRC20数字资产的开发包,该开发包支持使用自有Tron区块链节点的应用场景,也支持基于Tron官方公共API服务的轻量级部署场景。提供的功能包括生成地址、验证地址、查询余额、交易转账、查询最新区块和查询交易信息等。详细信息可参考tron-php的Github地址:https://github.com/Fenguoz/tron-php。 ... [详细]
  • LVS实现负载均衡的原理LVS负载均衡负载均衡集群是LoadBalance集群。是一种将网络上的访问流量分布于各个节点,以降低服务器压力,更好的向客户端 ... [详细]
author-avatar
汜水
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有