首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >编译pytorch时出错:“cstdint”文件未找到

编译pytorch时出错:“cstdint”文件未找到
EN

Stack Overflow用户
提问于 2017-04-26 17:05:03
回答 1查看 883关注 0票数 0

我试图在Mac上使用NO_CUDA=1 python setup.py install编译py手电筒,但我得到了以下错误:

代码语言:javascript
复制
In file included from /Users/ezyang/Dev/pytorch-tmp/torch/lib/tmp_install/include/THPP/Tensor.hpp:3:
/Users/ezyang/Dev/pytorch-tmp/torch/lib/tmp_install/include/THPP/Storage.hpp:6:10: fatal error: 
      'cstdint' file not found
#include <cstdint>
         ^
1 error generated.
In file included from torch/csrc/autograd/functions/init.cpp:2:
In file included from torch/csrc/autograd/functions/batch_normalization.h:4:
In file included from /Users/ezyang/Dev/pytorch-tmp/torch/lib/tmp_install/include/THPP/THPP.h:4:
/Users/ezyang/Dev/pytorch-tmp/torch/lib/tmp_install/include/THPP/Storage.hpp:6:10: fatal error: 
      'cstdint' file not found
#include <cstdint>
         ^
1 error generated.
1 error generated.
1 error generated.
1 error generated.
In file included from torch/csrc/autograd/python_hook.cpp:5:
In file included from /Users/ezyang/Dev/pytorch-tmp/torch/csrc/THP.h:32:
/Users/ezyang/Dev/pytorch-tmp/torch/csrc/utils.h:6:10: fatal error: 
      'type_traits' file not found
#include <type_traits>
         ^
13 errors generated.
1 error generated.
1 error generated.
error: command 'gcc' failed with exit status 1
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-04-26 17:05:03

您需要设置环境变量才能让Python在OS上使用正确的C编译器。您应该这样做:

代码语言:javascript
复制
NO_CUDA=1 MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++  python setup.py install
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43640454

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档