Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 错误:命令';gcc&x27;失败,退出状态为1;克隆后无法进行复制_Python 2.7_Amazon Web Services_Tensorflow_Ubuntu 16.04 - Fatal编程技术网

Python 2.7 错误:命令';gcc&x27;失败,退出状态为1;克隆后无法进行复制

Python 2.7 错误:命令';gcc&x27;失败,退出状态为1;克隆后无法进行复制,python-2.7,amazon-web-services,tensorflow,ubuntu-16.04,Python 2.7,Amazon Web Services,Tensorflow,Ubuntu 16.04,我正在尝试运行eval.py来评估我的培训课程。为此,我需要安装cocodataset(请参阅下面的错误消息)。这就是错误发生的地方 我试过了 sudo-apt-get-update&&sudo-apt-get-upgrade 卸载并重新安装cython、gcc、numpy 在我看来,关于gcc有很多错误,这使我认为我的错误可能与cocodataset无关,但可能与我的包或环境变量有关。我需要关于如何解决问题或可能在哪里寻找的建议/指导。非常感谢您的帮助!提前谢谢 系统信息 Distribu

我正在尝试运行eval.py来评估我的培训课程。为此,我需要安装cocodataset(请参阅下面的错误消息)。这就是错误发生的地方

我试过了

  • sudo-apt-get-update&&sudo-apt-get-upgrade
  • 卸载并重新安装cython、gcc、numpy
在我看来,关于gcc有很多错误,这使我认为我的错误可能与cocodataset无关,但可能与我的包或环境变量有关。我需要关于如何解决问题或可能在哪里寻找的建议/指导。非常感谢您的帮助!提前谢谢

系统信息

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial
Python 2.7.14 :: Anaconda, Inc

Running on AWS Deep Learning AMIs
错误


正如您在上面看到的,我得到了以下错误:命令“gcc”失败,退出状态为1

您安装完gcc了吗?我想你应该检查一下,我在制作coco-lib时出现了一些错误,我刚刚意识到主机中包含了一些gcc包。 尝试:

然后


并确保已成功安装gcc。

这不起作用。我最终使用了一个预配置和安装的映像,该映像与安装的必需品一起提供。
git clone https://github.com/pdollar/coco.git
Cloning into 'coco'...
remote: Counting objects: 927, done.
remote: Total 927 (delta 0), reused 0 (delta 0), pack-reused 927
Receiving objects: 100% (927/927), 11.68 MiB | 3.14 MiB/s, done.
Resolving deltas: 100% (554/554), done.
Checking connectivity... done.

(tensorflow_p27) ubuntu@remoteip:~/tmp$ cd coco/PythonAPI/

(tensorflow_p27) ubuntu@remoteip:~/tmp/coco/PythonAPI$ make
python setup.py build_ext --inplace
Compiling pycocotools/_mask.pyx because it changed.
[1/1] Cythonizing pycocotools/_mask.pyx
running build_ext
building 'pycocotools._mask' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/pycocotools
creating build/common
gcc -pthread -B /home/ubuntu/anaconda3/envs/tensorflow_p27/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/ubuntu/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/numpy/core/include -I../common -I/home/ubuntu/anaconda3/envs/tensorflow_p27/include/python2.7 -c pycocotools/_mask.c -o build/temp.linux-x86_64-2.7/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
gcc -pthread -B /home/ubuntu/anaconda3/envs/tensorflow_p27/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/ubuntu/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/numpy/core/include -I../common -I/home/ubuntu/anaconda3/envs/tensorflow_p27/include/python2.7 -c ../common/maskApi.c -o build/temp.linux-x86_64-2.7/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
gcc -pthread -shared -B /home/ubuntu/anaconda3/envs/tensorflow_p27/compiler_compat -L/home/ubuntu/anaconda3/envs/tensorflow_p27/lib -Wl,-rpath=/home/ubuntu/anaconda3/envs/tensorflow_p27/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-2.7/pycocotools/_mask.o build/temp.linux-x86_64-2.7/../common/maskApi.o -L/home/ubuntu/anaconda3/envs/tensorflow_p27/lib -lpython2.7 -o /home/ubuntu/tmp/coco/PythonAPI/pycocotools/_mask.so
/home/ubuntu/anaconda3/envs/tensorflow_p27/compiler_compat/ld: cannot find -lpthread
/home/ubuntu/anaconda3/envs/tensorflow_p27/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Makefile:3: recipe for target 'all' failed
make: *** [all] Error 1
sudo apt-get update 
sudo apt-get gcc