You are viewing a single comment's thread from:

RE: [DA series - Learn Python with Steem #08] 函式庫(Modules)的安裝與使用,準備好玩Steem!

我是Mac... 執行python get-pip.py後,錯誤訊息如下:

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Consider using the --user option or check the permissions.

對!我也是同學啦,大家別搞錯了... 快來幫我解決問題吧~~

Sort:  

没有mac,应该是权限不够,用root用户权限安装一下,Ubuntu上是在命令前面加sudo 使用root权限,图片.png

mac 的话等你去探索一下。

或者在命令后面加--user
图片.png

咦?加 --user似乎就裝好了.... 但是還有這個訊息:

The script wheel is installed in '/Users/xxxxxx/Library/Python/2.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

然後終端機還是認不得pip指令.... 是不是跟這段話有關呢?

对的,安装目录没有添加到PATH这个环境变量 ,所以找不到pip。
可以试一下:

export PATH="$PATH:/Users/xxxxxx/Library/Python/2.7/bin"

然后把PATH里的目录打印出来看看有没有添加成功:

echo $PATH

其他的方法:

  • 把目录添加到 /etc/paths 文件
  • 新建一个 /etc/paths.d/XXX文件 把目录添加到里面

由于没有mac设备,这些方法没有验证是否有效,
可以放Google 找一下“mac path”看有没有有效的方法。

後面執行有問題嗎?
貌似這個pip是裝到python2底下(應該是有內建python2.7),可以試試看用以下方法確定安裝pip到python3之下:
(btw,電腦裡同時有python2跟python3的話,在執行python程式時要輸入python3 script.py

# download and install setuptools
curl -O https://bootstrap.pypa.io/ez_setup.py
python3 ez_setup.py
# download and install pip
curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py

這個新安裝的pip會被稱為pip3
所以你裝完之後可以試試看

pip3 install steem-python

看不懂你說的,但照做了,最後出現紅訊息:

Could not find a version that satisfies the requirement steem-python (from versions: )
No matching distribution found for steem-python

@antonsteemit 命令写错了
pip3 install steem-python

你看文章开头:

pip3 install steem

感謝!輸入後,跑了好多好多東西出來,但其中不停出現紅色訊息,一共4條,最後一條最長,給各位看看:

Failed building wheel for scrypt
Failed building wheel for pycrypto
Failed building wheel for ujson
Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c "import setuptools, tokenize;file='/private/var/folders/c8/23zvw8w5501g6wnhpd0gjt_h0000gn/T/pip-install-cj0tzfjw/scrypt/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/c8/23zvw8w5501g6wnhpd0gjt_h0000gn/T/pip-record-3f6wksc0/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/c8/23zvw8w5501g6wnhpd0gjt_h0000gn/T/pip-install-cj0tzfjw/scrypt/

我晚點再來試試後面的步驟能不能做....

Coin Marketplace

STEEM 0.20
TRX 0.25
JST 0.038
BTC 96656.73
ETH 3341.70
USDT 1.00
SBD 3.20