上記の「./configure」文のあとで make を実行しました。そしてログを確認すると下記の通り _ctypes のエラーはなくなりました。_zoneinfo は何かよくわかりませんし特に今回必要だとも思ってないので無視します。
Failed to build these modules:
_zoneinfo
今回は「pip3 install mysqlclient」も無事成功しました。
% pip3 install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.0.3.tar.gz (88 kB)
Using legacy 'setup.py install' for mysqlclient, since package 'wheel' is not installed.
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... done
Successfully installed mysqlclient-2.0.3
WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
You should consider upgrading via the '/home/xxxxxx/local/python/bin/python3.9 -m pip install --upgrade pip' command.
%
まず Homebrew で MySQL をインストールする必要があるので「brew install mysql」を実行します。
これをしていないとこの後 pip で「mysqlclient」のインストールができません。
(scraping) % brew install mysql
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
acl2 heksa nfpm
act httpx ngs
airshare hy notmuch-mutt
alsa-lib i686-elf-binutils numcpp
amp i686-elf-gcc oci-cli
apidoc idris2 omake
arb infracost openfst
argo inja oq
argocd inko ormolu
arrayfire ioctl ory-hydra
asimov jerryscript osi
asroute jimtcl osm
athenacli jinx packetbeat
austin jobber packr
awsweeper jsonnet-bundler pandoc-include-code
blogc k9s pandocomatic
bombadillo kde-karchive parallel-hashmap
bond kde-kdoctools periscope
borgbackup kde-ki18n pipgrip
box2d kde-threadweaver po4a
buildozer kona podman
c7n kondo postgresql@12
cadence ksync prometheus-cpp
carton kubie promtail
cassowary ladspa-sdk protoc-gen-go-grpc
castget latexindent protoc-gen-gogo
cbc ldpl protoc-gen-gogofaster
cdktf leaf pwncat
cgl libaio python@3.7
chalk-cli libcouchbase@2 python@3.9
charge libdmx reg
chart-testing libdrm rgf
choose-rust libfontenc rqlite
chrony libfs rust-analyzer
clair libgccjit rustscan
clang-format@8 libgnt s2n
cli11 libhandy saltwater
cloud-nuke libice scw@1
cloudformation-cli libirecovery sdns
cloudformation-guard libmnl server-go
coconut libnetfilter-queue shallow-backup
colfer libnetworkit sheldon
commitizen libnfnetlink shtools
copilot liboqs silicon
coredns libpciaccess simdjson
cortex libpthread-stubs skylighting
cpio libseccomp sleef
cpm libsm smlpkg
cpr libx11 snap
croaring libxau so
croc libxaw solidity
cubejs-cli libxaw3d sonic
cvs-fast-export libxcb sponge
datasette libxcomposite sqlite-utils
dbdeployer libxcursor standardese
diskonaut libxdamage staticcheck
dnsprobe libxdmcp structurizr-cli
doctest libxext subfinder
dosbox-staging libxfixes termcolor
dotnet libxfont terraform-ls
duckscript libxft terraform@0.12
eksctl libxi terrascan
eleventy libxinerama tfsec
empty libxkbfile thanos
envoy libxmu toot
fava libxpm torchvision
fblog libxrandr tre-command
fennel libxrender trunk
fetch libxres ugrep
flank libxscrnsaver uptoc
fleet-cli libxshmfence usb.ids
flit libxt util-macros
folderify libxtst vapor
font-util libxv vcpkg
foreman libxvmc vgrep
fpart libxxf86dga vivid
fpdns libxxf86vm vlang
functionalplus litecli volk
gateway-go localstack vsearch
gcc@9 logcli vtk@8.2
git-hooks-go loki webify
git-hound lunchy wgcf
gitql lunchy-go wownero
gitui macos-trash wren
gluon mandown wren-cli
go@1.14 mariadb@10.4 x86_64-elf-gdb
gofish marked xcb-proto
golangci-lint mask xdpyinfo
gostatic matplotplusplus xorgproto
gradle-profiler mhonarc xtrans
gravity microplane yj
grpcui naabu z.lua
gulp-cli nanorc zoxide
halide nest zsh-you-should-use
hashlink networkit
hasura-cli never
==> Updated Formulae
Updated 4645 formulae.
==> Renamed Formulae
elasticsearch@6.8 -> elasticsearch@6
gst-validate -> gst-devtools
interactive-rebase-tool -> git-interactive-rebase-tool
jfrog-cli-go -> jfrog-cli
kibana@6.8 -> kibana@6
mkl-dnn -> onednn
==> Deleted Formulae
baidupcs-go elasticsearch@5.6 marathon-swift unravel
biogeme highlighting-kate python urbit
cargo-completion i386-elf-grub residualvm wpscan
cryptopp kibana@5.6 sflowtool xu4
elasticsearch@2.4 lumo tomee-jax-rs
==> Downloading https://homebrew.bintray.com/bottles/openssl%401.1-1.1.1h.catali
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/4e5357c0cfd55cfa4ef0b
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/protobuf-3.13.0.catalina.bo
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/af2990ba0a6e5588ef2af
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/mysql-8.0.21_1.catalina.bot
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/81e92d0df39edaff415e7
######################################################################## 100.0%
==> Installing dependencies for mysql: openssl@1.1 and protobuf
==> Installing mysql dependency: openssl@1.1
==> Pouring openssl@1.1-1.1.1h.catalina.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl@1.1/certs
and run
/usr/local/opt/openssl@1.1/bin/c_rehash
openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have openssl@1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
==> Summary
🍺 /usr/local/Cellar/openssl@1.1/1.1.1h: 8,067 files, 18.5MB
==> Installing mysql dependency: protobuf
==> Pouring protobuf-3.13.0.catalina.bottle.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/protobuf
==> Summary
🍺 /usr/local/Cellar/protobuf/3.13.0: 266 files, 19.8MB
==> Installing mysql
==> Pouring mysql-8.0.21_1.catalina.bottle.tar.gz
==> /usr/local/Cellar/mysql/8.0.21_1/bin/mysqld --initialize-insecure --user=ken
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
To have launchd start mysql now and restart at login:
brew services start mysql
Or, if you don't want/need a background service you can just run:
mysql.server start
==> Summary
🍺 /usr/local/Cellar/mysql/8.0.21_1: 290 files, 291.2MB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /Users/xxxxxxxx/Library/Caches/Homebrew/gettext--0.20.2_1.catalina.bottle.tar.gz... (8.4MB)
Removing: /Users/xxxxxxxx/Library/Caches/Homebrew/libidn2--2.3.0.catalina.bottle.tar.gz... (233.6KB)
Removing: /Users/xxxxxxxx/Library/Caches/Homebrew/libunistring--0.9.10.catalina.bottle.tar.gz... (1.4MB)
Removing: /usr/local/Cellar/openssl@1.1/1.1.1g... (8,059 files, 18MB)
Removing: /Users/xxxxxxxx/Library/Caches/Homebrew/openssl@1.1--1.1.1g.catalina.bottle.tar.gz... (5.3MB)
Removing: /Users/xxxxxxxx/Library/Caches/Homebrew/tree--1.8.0.catalina.bottle.tar.gz... (49.5KB)
Removing: /Users/xxxxxxxx/Library/Caches/Homebrew/wget--1.20.3_2.catalina.bottle.tar.gz... (1.4MB)
Removing: /Users/xxxxxxxx/Library/Logs/Homebrew/tree... (64B)
Removing: /Users/xxxxxxxx/Library/Logs/Homebrew/wget... (64B)
Removing: /Users/xxxxxxxx/Library/Logs/Homebrew/libidn2... (64B)
Removing: /Users/xxxxxxxx/Library/Logs/Homebrew/libunistring... (64B)
Removing: /Users/xxxxxxxx/Library/Logs/Homebrew/gettext... (64B)
Removing: /Users/xxxxxxxx/Library/Logs/Homebrew/openssl@1.1... (64B)
Pruned 1 symbolic links and 2 directories from /usr/local
==> Caveats
==> openssl@1.1
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl@1.1/certs
and run
/usr/local/opt/openssl@1.1/bin/c_rehash
openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have openssl@1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
==> protobuf
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/protobuf
==> mysql
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
To have launchd start mysql now and restart at login:
brew services start mysql
Or, if you don't want/need a background service you can just run:
mysql.server start
長々とログが出ましたが、入力待ちになったら which コマンドで mysql がインストールされたのを確認します。
(scraping) % which mysql
/usr/local/bin/mysql
/usr/local/bin/mysql にインストールされています。
MySQL の動作を確認
MySQL を起動
「mysql.server start」と入力して MySQL を起動してみます。
% mysql.server start
Starting MySQL
.. SUCCESS!
%
無事起動しました。
MySQL をシャットダウン
「mysql.server stop」でシャットダウンすることができます。
% mysql.server stop
Shutting down MySQL
.. SUCCESS!
%
mysqlclient をインストール
pip で mysqlclient をインストールします。
(scraping) % pip install mysqlclient
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/a5/e1/e5f2b231c05dc51d9d87fa5066f90d1405345c54b14b0b11a1c859020f21/mysqlclient-2.0.1.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... done
Successfully installed mysqlclient-2.0.1
WARNING: You are using pip version 19.2.3, however version 20.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(scraping) %
Installing collected packages: setuptools, pip
WARNING: The script easy_install-3.9 is installed in '/home/XXXXXX/local/python/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts pip3 and pip3.9 are installed in '/home/XXXXXX/local/python/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.2.3 setuptools-49.2.1
%
# $FreeBSD: src/share/skel/dot.cshrc,v 1.14.6.1 2008/11/25 02:59:29 kensmith Exp
$
#
# .cshrc - csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
#
alias h history 25
alias j jobs -l
alias la ls -a
alias lf ls -FA
alias ll ls -lA
# A righteous umask
umask 22
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin)
setenv EDITOR vi
setenv PAGER more
setenv BLOCKSIZE K
setenv PKG_DBDIR ~/db/pkg
if ($?prompt) then
# An interactive shell -- set some stuff up
set filec
set history = 100
set savehist = 100
set mail = (/var/mail/$USER)
if ( $?tcsh ) then
bindkey "^W" backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward
endif
endif
% python3
Python 3.8.3 (v3.8.3:6f8c8320e9, May 13 2020, 16:29:34)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> pip install requests
Last login: Sun May 17 19:09:43 on ttys000
~ % /Applications/Python\ 3.8/Install\ Certificates.command ; exit;
-- pip install --upgrade certifi
Collecting certifi
Downloading https://files.pythonhosted.org/packages/57/2b/26e37a4b034800c960a00c4e1b3d9ca5d7014e983e6e729e33ea2f36426c/certifi-2020.4.5.1-py2.py3-none-any.whl (157kB)
|████████████████████████████████| 163kB 635kB/s
Installing collected packages: certifi
Successfully installed certifi-2020.4.5.1
WARNING: You are using pip version 19.2.3, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
-- removing any existing file or link
-- creating symlink to certifi certificate bundle
-- setting permissions
-- update complete
[プロセスが完了しました]
4. 動作確認
ターミナルで「python3」と入力すると Python3 を開始できます。「python」と入力すると mac にデフォルトで入っている旧バージョンの python が起動するので注意してください。
~ % python3
Python 3.8.3 (v3.8.3:6f8c8320e9, May 13 2020, 16:29:34)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>