简体   繁体   English

模块未找到与我尝试导入的内容无关的模块错误

[英]Module Not Found Error for a module that is unrelated to what I'm trying to import

I am trying to import a module in Python, but I keep getting the same error message, and I don't understand where it's coming from.我试图在 Python 中导入一个模块,但我不断收到相同的错误消息,而且我不明白它来自哪里。 I have even tried running the line below in a new bank document, and it still came up with he same issue.我什至尝试在新的银行文件中运行下面的行,但仍然遇到同样的问题。

import fastscape
from fastscape.models import basic_model

The error message it shows is the following:它显示的错误消息如下:

Traceback (most recent call last):

  File ~\[redacted local file directory].py:2 in <module>
    import fastscape

  File ~\anaconda3\lib\site-packages\fastscape\__init__.py:6 in <module>
    from . import processes

  File ~\anaconda3\lib\site-packages\fastscape\processes\__init__.py:1 in <module>
    from .boundary import BorderBoundary

  File ~\anaconda3\lib\site-packages\fastscape\processes\boundary.py:6 in <module>
    from .context import FastscapelibContext

  File ~\anaconda3\lib\site-packages\fastscape\processes\context.py:1 in <module>
    import fastscapelib_fortran as fs

ModuleNotFoundError: No module named 'fastscapelib_fortran'

Except, as far as I am aware, there is no 'fastscapelib_fortran' in that model.除了,据我所知,model 中没有'fastscapelib_fortran'

Following the documented install instructions works great.按照记录的安装说明进行操作效果很好。

$ conda create --name myproj
...
$ conda activate myproj
$
$ conda install fastscape -y -c conda-forge
...
$
$ python -c 'import fastscape'                                                                                               
$ python -c 'import fastscapelib_fortran'
$
$ conda list | grep fastscape                                                                                                
fastscape                 0.1.0beta3         pyhd8ed1ab_0    conda-forge                                                                                        
fastscapelib-f2py         2.8.3           py310h96b8b03_0    conda-forge
$ python --version
Python 3.10.8

The imports work fine, with no error.导入工作正常,没有错误。 Conda pulled in all the deps.康达召集了所有部门。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将模块导入模块,无法解释我要做什么 - Import a module into a module, can't explain what i'm trying to do 尝试导入 pandas 时 Python 中未找到模块错误 - Module not found error in Python while trying to import pandas 导入 sutime 模块时出现以下导入错误 - 这是什么意思? - I'm getting the following Import Error when importing the sutime module - what does it mean? Pyinstaller 导入错误:找不到模块 - Pyinstaller import error: module not found 我在使用“import module [...] module.x”时遇到错误,但在使用“from module import x”时却没有。 有什么不同? - I'm getting bug when using "import module [...] module.x" but not when using "from module import x". What's the difference? 在 Python 中,我试图在一个返回值的函数中导入一个单独的模块文件,但一直出错,有什么想法吗? - in Python, I'm trying to import a separate module file within a value-returning function but keep getting an error, any ideas? 导入 python - 未找到模块错误 - 父导入 - import python - no module found error - parent import 尝试导入 NLTK 模块时出现导入错误 - Import Error when trying to import NLTK module 我已经安装了 textblob,当我在 py 解释器上单独导入它时它可以工作,但是我运行的程序它给出了模块未找到错误 - I have installed textblob and it works when I import it separately on py interpretor but what I run program it gives module not found error 我正在尝试从另一个模块导入另一个函数,但我在 M1 Mac 上得到了这个 - I am trying to import another function from another module but I am getting this on an M1 Mac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM