![](/img/trans.png)
[英]when I try to install Flask-bcrypt it throws me error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
[英]When I try to install Pygame through Terminal it gives me this: error: command 'gcc' failed with exit status 1
我有一台在Catalina
運行的 mac。 我對python
和使用終端很python
。
我已經安裝了python
並且我正在嘗試安裝Pygame
。 我試圖通過這個命令安裝它:
-m pip install Pygame==1.9.3
您必須首先使用以下方法之一安裝pip
:
對於 Python 3
sudo apt-get install python3-pip
對於 Python 2
sudo apt-get install python-pip
然后你必須運行python -m pip install pygame==1.9.3
它應該可以工作。
我使用了這個命令,它對我有用:
python -m pip install pygame
我在 macOS High Sierra 和 Windows 10 上工作過
編輯:要安裝 pip,請訪問https://python.org/downloads 。 然后下載最新版本的python。 完成安裝,直到您到達有一個顯示“自定義”按鈕的頁面。 點擊它。 應該會彈出一個菜單欄。 選中“安裝或升級 pip”旁邊的框。 然后安裝python。 Pip 應該會自動安裝,你應該可以使用上面的命令。 這是一個有用的鏈接: https : //cs.hofstra.edu/docs/pages/guides/InstallingPygame.html ,滾動到“Procedure (Mac OS X)”的位置。
編輯2 :上面的命令是針對python2的,要為python3安裝pygame,在終端中執行這個命令:
python3 -m pip install pygame
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.