马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 Zealot001 于 2021-6-28 15:12 编辑
按照官方文档给出的方法
pip2 install --target game/python-packages requests
我已经成功导入了requests模块
[RenPy] 纯文本查看 复制代码 init -1 python:
import requests
单纯导入requests模块游戏可以正常运行
但是按照相同的方法,导入numpy模块
pip2 install --target game/python-packages numpy
游戏运行就会出现问题
[RenPy] 纯文本查看 复制代码 init -1 python:
import requests
import numpy as np
[RenPy] 纯文本查看 复制代码 I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script/mainfun.rpy", line 1, in script
init -1 python:
File "game/script/mainfun.rpy", line 1, in script
init -1 python:
File "game/script/mainfun.rpy", line 3, in <module>
import numpy as np
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
1. Check that you are using the Python you expect (you're using D:/renpy/renpy-7.4.6-sdk/lib/windows-x86_64\pythonw.exe),
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy versions you're trying to use.
2. If (1) looks fine, you can open a new issue at
[url=https://github.com/numpy/numpy/issues.]https://github.com/numpy/numpy/issues.[/url] Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: No module named _multiarray_umath
按照traceback给出的方案排查,安装python2的方式,电脑的操作系统,安装多版本python应该都没有问题
但我重新用pip安装numpy(版本号1.16.6),仍然报错
具体是什么原因,实在是搞不清了,求大佬解答
|