python3 で requests ( _ssl )が import できなくなった場合 (mac)

(Comments)

Traceback (most recent call last):
  File "/Applications/Develop/PyCharm.app/helpers/pycharm/django_test_manage.py", line 51, in <module>
    django.setup()
  ...
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  ...
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ssl.py", line 97, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: dlopen(/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload/_ssl.so, 2): Symbol not found: _SSLv2_method
  Referenced from: /usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload/_ssl.so
  Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
 in /usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload/_ssl.so

こんなエラーが出るようになった。

brew で python を入れなおし、virtualenv を作りなおしたら直った

$ brew unlink python3
$ brew install python3

$ rm -r .virtualenvs/myvirtualenv

$ pyvenv-3.4 .virtualenvs/myvirtualenv
$ workon myvirtualenv
$ pip install --upgrade pip
$ pip install -r requirements.txt
...

※ brew install python したら、vim を起動する時に

    import io as _io
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyErr_ReplaceException

こんなのが出たので、brew uninstall python で削除した。

Currently unrated

Comments

Recent Tweets

  • ytyng

    ytyng @ytyng

    なおってた
    2 days, 13 hours ago

  • ytyng

    ytyng @ytyng

    vuetify って2になって、グリッドのタグ名がBootstrapと同じになったのね。v-flex と書かなくてよくなってた。良い。
    2 days, 13 hours ago

  • ytyng

    ytyng @ytyng

    YahooショッピングのAPI、応答を返さない状態じゃない? https://t.co/rYKTlr7RcU
    2 days, 16 hours ago

Recent Posts

Archive

2020
2019
2018
2017
2016
2015
2014
2013
2012
2011

Categories

Authors

Feeds

RSS / Atom