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

ScoreDraft 模块无法导入 #9

Open
ZeroAurora opened this issue Jul 16, 2018 · 9 comments
Open

ScoreDraft 模块无法导入 #9

ZeroAurora opened this issue Jul 16, 2018 · 9 comments

Comments

@ZeroAurora
Copy link

运行任意一个 python_test 目录下的示例,得出如下 Traceback:

Traceback (most recent call last):
  File "C:\Users\zeroa\repos\ScoreDraft-master\python_test\Hello.py", line 3, in <module>
    import ScoreDraft
  File "C:\Users\zeroa\repos\ScoreDraft-master\python_test\ScoreDraft\__init__.py", line 2, in <module>
    from . import PyScoreDraft
ImportError: DLL load failed: 找不到指定的模块。
@fynv
Copy link
Owner

fynv commented Jul 16, 2018

In ReadMe, I said:

Run CMake to generate makefiles/project files for your system and build. You are recommanded to:

use the /build directory as you building directory i
use /python_test as your CMAKE_INSTALL_PREFIX

In Windows, you can set the variable CMAKE_INSTALL_PREFIX in the cmake GUI.
If CMAKE_INSTALL_PREFIX is already pointed to "python_test", you just need to build the "INSTALL" project in VS after "BUILD_ALL" succeeded.

@ZeroAurora
Copy link
Author

也就是说现在没有预编译模块了?

@fynv
Copy link
Owner

fynv commented Jul 16, 2018

啊抱歉,如果是下载后直接运行例子是不应该出现这个问题的。
请检查以下可能的问题:

  1. python_test/ScoreDraft/PyScoreDraft.pyd 是否因某种原因丢失
  2. 操作系统是否为64位Windows. 32位系统这个模块是不兼容的
  3. 系统中是否存在Python 2.x. 如果有的话,请尝试以下指令运行:
    python_test> python3 Hello.py

@ZeroAurora
Copy link
Author

ZeroAurora commented Jul 16, 2018

三问题均无

@fynv
Copy link
Owner

fynv commented Jul 16, 2018

我看了一下PyScoreDraft.pyd依赖的其他DLL:

PYTHON36.DLL : 看来你的python必须是3.6版本才能直接用这个build
KERNEL32.DLL: 没什么好说
MSVCP120.DLL & MSVCR120.DLL: 需要VC2013的 Runtime (vcredist_x64)

以上我能想到的。

@ZeroAurora
Copy link
Author

必须是 py3.6?我装的 py 3.7

@ZeroAurora
Copy link
Author

估摸着要自己编译一份了

@LovelyA72
Copy link

LovelyA72 commented Feb 20, 2019

I tried in my python that pre-installed in my system and it does not work:
image

However, WinPython and Anaconda work flawlessly:
image
image

So, in conclusion, I think the problem can be the reason that Python 3.7 is not supported in ScoreDraft. You can try to grab a copy of WinPython (with Python 3.6) since it's portable and does not require an uninstallation to get rid of it.

@fynv
Copy link
Owner

fynv commented Feb 20, 2019

确实,用Python Extension这种方式会导致只兼容固定的Python版本,我回头用Python3.7编译一份去。

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

3 participants