你好,我使用默认设置syslab 2025b按照下图官网教程中提供的源代码测试使用PyCall库
总是报错,你们官网教程的案例源码也没有找到,我想知道是哪里错了。代码我也上传,报错信息如下:
ERROR: PyError (PyImport_ImportModule
The Python package myfunction.function could not be imported by pyimport. Usually this means
that you did not install myfunction.function in the Python version being used by PyCall.
PyCall is currently configured to use the Python version at:
C:\Users\Public\TongYuan.julia\miniforge3\python.exe
and you should use whatever mechanism you usually use (apt-get, pip, conda,
etcetera) to install the Python package containing the myfunction.function module.

One alternative is to re-configure PyCall to use a different Python
version on your system: set ENV["PYTHON"] to the path/name of the python
executable you want to use, run Pkg.build("PyCall"), and re-launch Julia.
Another alternative is to configure PyCall to use a Julia-specific Python
distribution via the Conda.jl package (which installs a private Anaconda
Python distribution), which has the advantage that packages can be installed
and kept up-to-date via Julia. As explained in the PyCall documentation,
set ENV["PYTHON"]="", run Pkg.build("PyCall"), and re-launch Julia. Then,
To install the myfunction.function module, you can use pyimport_conda("myfunction.function", PKG),
where PKG is the Anaconda package that contains the module myfunction.function,
or alternatively you can use the Conda package directly (via
using Conda followed by Conda.add etcetera).
) <class 'ModuleNotFoundError'>
ModuleNotFoundError("No module named 'myfunction'")
Stacktrace:
[1] pyimport(name::String)
@ PyCall C:\Users\Public\TongYuan.julia\packages\PyCall\9ZDyP\src\PyCall.jl:595
[2] top-level scope
@ C:\Users\Public\TongYuan.julia\packages\PyCall\9ZDyP\src\PyCall.jl:639
