我在Mac OS x Sierra中使用matlab 2016b和Python 2.7。
当我导入RTLD_NOW = 2;
RTLD_DEEPBIND = 8;
flag = bitor(RTLD_NOW, RTLD_DEEPBIND);
py.sys.setdlopenflags(int32(flag));
py.importlib.import_module('requests');
时,我得到了一个没有模块的' python错误。同样适用于网络套接字'太。但是当我尝试在具有相同Python版本的终端中执行相同操作时,我获得了输出。
我已尝试过以下解决方案,但它无效。
res <- t(sapply(strsplit(test, " "), function(x) {
i1 <- grep("[/]", x)
x1 <- x[i1]
d1 <- do.call(rbind.data.frame, strsplit(x1, "[/]"))[2:1]
colnames(d1) <- c("key", "val")
d1$key <- factor(d1$key, levels = c("POS", "NEG", "AD", "FE"))
t1 <- t(table(d1))
colSums(t1)}))
library(stringr)
res[,4] <- str_extract(test, "\\w+(?=/FE)")
答案 0 :(得分:0)
您可以尝试使用
找到丢失的python模块import the_missing_module
import os
path = os.path.dirname(the_missing_module.__file__)
print path
然后检查path
是否在MATLAB搜索路径子集中。