模块:未找到命令
我正在尝试加载几个模块以在 Linux 上构建库,但被告知命令“模块”不存在。我用谷歌搜索了一下,发现解决方案是获取一个名为“module”的目录,尽管进行了大量搜索,但我仍无法找到该目录。
我不太确定我应该做什么,任何帮助都会受到赞赏(知道我正在使用的 makefile 使用 csh 而我的默认 shell 是 bash 可能会有所帮助)。谢谢!
I'm attempting to load several modules for building a library on Linux but am told that the command 'module' doesn't exist. I've Googled around and discovered that the solution was to source a directory called "module" which I am unable to locate despite extensive searching.
I'm not quite sure what I should and any help would be appreciated (it might help to know that the makefile I'm working with uses csh while my default shell is bash). Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我尝试重现它,结果发现对我来说,
在
.sh
脚本中进行采购有助于bash
等。对于csh
和tcsh
,您必须添加到脚本中。请注意,该行必须先出现,然后才是该
行。
I tried to reproduce it and it turns out that for me sourcing
in th
.sh
script helps forbash
and similar. Forcsh
andtcsh
, you have to addto the script. Note, that this line must come first and then the
line.
我来到这里是因为我正在寻找在 CentOS7 和 https://blog.remirepo.net/post/2019/05/22/PHP-7.4-as-Software-Collection 是我尝试关注并遇到相同问题的文章之一“模块:找不到命令”问题。
通过命令获取 /etc/profile:
。 /etc/profile
似乎使“模块加载”工作。
归功于 https://forums.fedoraforum.org/showthread 中的 fadishei .php?262708-module-command-not-found
要使 php 版本(例如 php7.4)持续存在,请将以下内容附加到文件
/etc/profile.d/custom.sh
重新启动并运行
php --version
来交叉检查 php 7.4 是否是当前安装的版本。I got here as I was searching for ways to install multiple php versions in CentOS7 and https://blog.remirepo.net/post/2019/05/22/PHP-7.4-as-Software-Collection was one of the articles I tried to follow and encountered the same "module: command not found" issue.
Sourcing /etc/profile via command:
. /etc/profile
seems to make the "module load" work.
Credits to fadishei in https://forums.fedoraforum.org/showthread.php?262708-module-command-not-found
To make the version of php (e.g. php7.4) persist, append the following to file
/etc/profile.d/custom.sh
Reboot and run the
php --version
to cross-check that php 7.4 is the current version installed.就我而言,我使用的是
zsh
而不是默认的bash
shell。切换到 bash 并提交脚本后,结果成功了
In my case, I was using
zsh
instead of the defaultbash
shell.After switching to
bash
and submitting the script, it worked out我认为您必须将其放入脚本中来定义模块命令:
I think that you have to put this in your script to define the module command:
这对我有用
This was working for me
本文档应该有助于访问
modules
shell 功能(安装然后打开一个新终端)以及如何创建或安装新模块(大多数安装中默认没有任何模块) )。来自我所做的研究表明,
Spack
和EasyBuild
可用于安装软件并为该软件创建modulefiles
。This documentation should help both with getting access to the
modules
shell function (install and then open up a new terminal) and on how to create or install new modules (there aren't any by default in most installs).From the research I have done,
Spack
andEasyBuild
can be used to install software and createmodulefiles
for that software.