LoginSignup
0
0

More than 5 years have passed since last update.

python3のPYTHONPATHにpython2.7のsite-packagesが紛れ込んでいた事件

Posted at

原因

/Users/ユーザー名/.local/lib/python3.5/site-packages/homebrew.pth

内に

import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")

と,python2.7のsite-packagesが入っていた。
そのため,python3スクリプト内で一部ライブラリをimportしようとした際にpython2.7版がインポートされようとし,エラーが出ていた。

対処

import site; site.addsitedir("/usr/local/lib/python3.5/site-packages")

と書き換える。

0
0
0

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
0
0