ModuleNotFoundError:即使安装后也没有名为“selenium”的模块

时间:2021-04-14 16:26:45

标签: python selenium

即使在我安装了 selenium 之后,我仍然收到错误“ModuleNotFoundError: No module named 'selenium'”。我运行了命令

input_path = './your_data_dir/' % Set the directory you will be loading your data from output_path = './your_output_dir/' % Set the directory you want to save the output to list = dir(input_path); % Get list of files file_list = {list.name}; % Store filenames in a cell array file_list(1:2) = []; % Delete the inodes '.' and '..' from files list % Loop through each file in the directory, from file 1 to file N-1 for i = 1:(length(file_list)-1) % Get file names, use curly brackets to extract string from cell array file_A = file_list{i}; file_B = file_list{i+1}; % Load the data var_A = load(file_A); var_B = load(file_B); % Format data var_combine = [var_A, var_B]; % Your Code var1 = [var_combine.var1]; var2 = [var_combine.var2]; var1 = var1(:,(1:25)); var2 = var2(:,(1:25)); % Use sprintf() to automatically generate filenames save_name = sprintf("%scombined_data_%d", output_path, i); % Save data % Note the quote marks for `var1` and `var2`, they are required save(save_name, 'var1', 'var2') end

并得到

pip show selenium

所以看起来我确实安装了它。但是当我输入时在 vscode 中

Version: 3.141.0 Summary: Python bindings for Selenium 表示找不到模块。

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

尝试重新启动您的 VS Code,它可能会起作用。如果没有帮助,请尝试重新安装 selenium 或确保 VS Code 中的 python 解释器。 谢谢