command ‘ cl.exe‘ failed: No such file or directory 问题的另一种解决办法

博主的python3.6版本下使用指令时
pip install pycocotools
出现以下报错:
command ' cl.exe' failed: No such file or directory

尝试了很多办法,包括安装对应版本Visual Studio、对应版本Visual Studio C++ Build Tools等,仍然无法解决。之后在另一台同为python3.6版本的电脑上成功安装pycocotools。于是将Lib\site-packages目录下(Lib中的L可能为大写,也可能为小写)的pycocotools文件夹和pycocotools-2.0.2.dist-info文件夹拷贝到为成功安装的电脑的目录下。问题解决。

但是如果将python3.6版本下的两个文件夹拷贝到python3.7版本下,运行时会报错。可能只能在相同版本python之间进行拷贝。

你可能感兴趣的:(教程,python)