gpt4 book ai didi

python - 找不到文件 python.h

转载 作者:太空宇宙 更新时间:2023-11-03 20:23:12 25 4
gpt4 key购买 nike

我正在尝试运行 gnu make,但它说找不到 python.h 文件,我认为这是由于 Python 未正确安装的结果。

我努力寻找安装Python的最佳方法,最初在3.6版本中通过macports安装它,然后像我使用pycharm一样安装anaconda,它使安装包变得更加容易,尽管我觉得我的Python安装现在可以了造成困惑。

python --version返回:Python 3.7.3

cat .bash_profile返回:

##
# Your previous /Users/jonathandyke/.bash_profile file was backed up as /Users/jonathandyke/.bash_profile.macports-saved_2019-06-30_at_22:20:05
##

# MacPorts Installer addition on 2019-06-30_at_22:20:05: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH
# added by Anaconda3 2019.03 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
. "/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<````

最佳答案

你可能以某种方式弄乱了头文件。尝试一下

brew uninstall python3
brew install python3

如果你使用的是 ubuntuapt-get install python3-dev 应该可以做到

关于python - 找不到文件 python.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58027400/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com