[~] python 0:26:55 Python 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np >>> exit() [~] python3 0:27:13 Python 3.6.4 (default, Jan 6 2018, 11:51:59) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'numpy' >>> exit() [~] sudo pip3 install numpy 0:27:36 Password: The directory '/Users/ryosukeyokota/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/ryosukeyokota/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Requirement already satisfied: numpy in /Library/Python/2.7/site-packages Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 324, in run requirement_set.prepare_files(finder) File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 666, in _prepare_file check_dist_requires_python(dist) File "/Library/Python/2.7/site-packages/pip/utils/packaging.py", line 48, in check_dist_requires_python feed_parser.feed(metadata) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/feedparser.py", line 177, in feed self._input.push(data) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/feedparser.py", line 99, in push parts = data.splitlines(True) AttributeError: 'NoneType' object has no attribute 'splitlines' [~]
python2でnumpyをインストールして、python3でも同じようにnumpyをインストールしたいのですが、上記のようなエラーが出てしまいうまくいきません。
おそらくRequirement already satisfied: numpy in /Library/Python/2.7/site-packages
がpython2にすでにnumpyはあるからインストールできないよ!といっています。pandas,matplotlibでも同様のエラーです。どうすればこのエラーを解決することができるでしょうか?回答よろしくお願いします。
追加の情報です。こちらでも同様にこのようなエラーが出ます。
[~] pip3 install numpy 0:27:56 Requirement already satisfied: numpy in /Library/Python/2.7/site-packages Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 324, in run requirement_set.prepare_files(finder) File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 666, in _prepare_file check_dist_requires_python(dist) File "/Library/Python/2.7/site-packages/pip/utils/packaging.py", line 48, in check_dist_requires_python feed_parser.feed(metadata) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/feedparser.py", line 177, in feed self._input.push(data) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/feedparser.py", line 99, in push parts = data.splitlines(True) AttributeError: 'NoneType' object has no attribute 'splitlines'
追加の情報です。よろしくお願いします。
[~] brew list | grep python 2:37:34 python3 [~] brew list | grep pyenv 2:37:43 pyenv pyenv-virtualenv [~] which pyenv 2:37:51 /usr/local/bin/pyenv [~] echo $PATH 2:37:58 /usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin [~] pyenv versions 2:38:05 system 3.6.0 3.6.1 3.6.3 anaconda3-4.3.1 * anaconda3-4.3.1/envs/py3.6.0 (set by /Users/ryosukeyokota/.python-version) anaconda3-4.3.1/envs/tensorflow [~]
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/02/16 15:57
2018/02/16 16:21
退会済みユーザー
2018/02/16 16:28
2018/02/16 16:50
退会済みユーザー
2018/02/16 17:22 編集
2018/02/16 17:23
退会済みユーザー
2018/02/16 17:40
2018/02/17 01:06
退会済みユーザー
2018/02/17 02:00
2018/02/17 02:21
退会済みユーザー
2018/02/17 02:43
2018/02/17 02:49
退会済みユーザー
2018/02/17 03:36 編集
2018/02/17 08:02
退会済みユーザー
2018/02/17 15:33