[PYTHON] What to do if scrapy doesn't work after installing scrapy with pip on mac

When I installed scrapy using pip normally, I got the following error and it did not go well, so I will summarize the countermeasures

cffi.ffiplatform.VerificationError: importing '/PATH/.virtualenvs/hoge/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_f3e4673fx399b1113.so': dlopen(/PATH/.virtualenvs/hoge/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_f3e4673fx399b1113.so, 2): Symbol not found: _CRYPTO_malloc_debug_init
  Referenced from: /PATH/.virtualenvs/hoge/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_f3e4673fx399b1113.so
  Expected in: flat namespace
 in /PATH/.virtualenvs/hoge/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_f3e4673fx399b1113.so

Cause

Since I installed openssl via macports, it seems that the cause is that the link of openssl cannot be done well with cryptography.

Coping

Specifies to use macports lib when installing libraries with pip.

#Put scrapy normally
pip install scrapy

#Erase cryptography once
pip uninstall cryptography

#Specify to use macports lib etc. and re-enter
ARCHFLAGS="-arch x86_64" LDFLAGS="-L/opt/local/lib" CFLAGS="-I/opt/local/include" pip install cryptography

Recommended Posts

What to do if scrapy doesn't work after installing scrapy with pip on mac
What to do if `pip install matplotlib` fails on Mac
What to do if Python doesn't work on Git for Windows
What to do if intellisense doesn't work with Anaconda + VSCode + Tensorflow2.1
What to do if rails s doesn't work
What to do if atom autocomplete-python doesn't work
What to do if pip install mysqlclient fails on MacOS
What to do if you can't install pyaudio with pip #Python
What to do if you get a UnicodeDecodeError with pip install
What to do after installing Linux (Ubuntu)
What to do if grep: empty (sub) expression appears on Mac grep
Defense notes when pip3 doesn't work with "ImportError: No module named'packaging'" after installing python3-pip on Debian8
What to do if the server doesn't start with python manage.py runserver
What to do if you can't install with pip in babun environment
What to do if you get Could not fetch URL 443 with pip
Note: What to do if pip install fails
[For beginners] What to do after installing Anaconda
What to do if pip cannot be installed
Let's Encrypt updated! What to do if the certbot renew command doesn't work
What to do if you get an error when installing python with pyenv
What to do if pip install fails in Xcode 5.1
What to do if you can't pip install mysqlclient
What to do if SciPy installation fails on CentOS
What to do if a UnicodeDecodeError occurs in pip
What to do if pip install fails to install dependent libraries
What to do if you installed pyenv on Mac OS using Homebrew but the python version doesn't switch
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if a communication error occurs due to proxy when installing with package management of pip, npm, gem
What to do if pip gives a DistributionError in Homebrew
What to do if you can't sort files with subscripts
What to do if you can't use WiFi on Linux
What to do if you get an Undefined error when trying to use pip with pyenv
What to do if yum breaks
What to do with Magics install
module install if pip install doesn't work
What to do with PYTHON release?
What to do to get tensorflow-gpu to work
What to do if the inode is exhausted on EC2 Linux
What to do if you can't build your project with Maven
What to do if PyAudio cannot be installed on Python 3.7, 3.8, 3.9 on Windows
Django: What to do if TemplateDoesNotExist at / admin / after setting templates
What to do if you get angry if you don't have libxml / xmlversion.h when installing lxml on CentOS
What to do if pip --user returns an error in a virtual environment created with pyenv
What to do if you get "The session could not be opened" when installing CentOS on VirtualBox
[Memorandum] What to do when a warning appears after executing pip list
What to do if you can't find well with grep's -f option
What to do if you get the message "" ~ .pkg "is corrupted and cannot be opened" when installing wxPython on Mac OS X
What to do if you couldn't send an email to Yahoo with Python.
What to do if ipython and python start up with different versions
What to do if you forget your login password on Manjaro Linux
What to do if you get lost in file reference with FileNotFoundError
What to do if you get stuck during Anaconda installation on Linux
What to do if the Chainer (Windows) sample mnist terminates with WinError 183.
What to do if pyenv install does not proceed with an error
What to do if an error occurs when importing numpy with VScode
What to do if you get a TypeError with numpy min, max
13 Things to Do After Installing Ubuntu 20.04 LTS
Notes on what to do when matplotlib scatter () / scatter3d () does not work
What to do if you get an error when installing Dlib (Ubuntu)
10 Things to Do After Installing Ubuntu 18.04 LTS
[Python] What to do if an error occurs in pip (pyinstaller, pyautogui, etc.)