LoginSignup
1
0

More than 5 years have passed since last update.

MacOSでUndefined error: 'Module_six_moves_urllib_parse' object has no attribute 'urlencode' が出てしまったときの対処方法

Posted at

GoogleApiを試そうと思ったときに少しハマったので原因と解決方法を書きます。

原因

Macにデフォルトでインストールされているpythonには既にsixというパッケージが/System/Library/Frameworks/Python.framework/Versions/2.7/Extras下にあるらしいです。
これが/Library/Python/2.7/site-packagesよりも先に解決されるため、パッケージがアップデートできないことが原因でした。

解決方法1

デフォルトのpythonを使わない。
これからpythonを使う方はこちらの解決方法が良いと思います。

解決方法2

以下のコマンドでも解決出来ました。

export PYTHONPATH=/Library/Python/2.7/site-packages

参考URL

https://github.com/google/google-api-python-client/issues/100
http://stackoverflow.com/questions/29485741/unable-to-upgrade-python-six-package-in-mac-osx-10-10-2/29666702#29666702

1
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0