環境をpyenv+pipenvに変更するため、インストール。ただの記録。

Mac上のPython仮想環境をpipenv+pyenvへ移行してみた | Developers.IO より

環境をpyenv+pipenvに変更するため、インストール。ただの記録。

sho-pro:~ owner$ brew install pipenv Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/cask). No changes to formulae.

==> Installing dependencies for pipenv: sqlite and python@3.8 ==> Installing pipenv dependency: sqlite ==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.31.1.catalina.bottle.tar.gz ==> Downloading from https://akamai.bintray.com/e0/e09e8c96db88178e4f47b0cdab6477c46fa582326900ec9309c3ce1b9f7ff9aa?gda=ex

################################################################## 100.0%

==> Pouring sqlite-3.31.1.catalina.bottle.tar.gz ==> Caveats sqlite is keg-only, which means it was not symlinked into /usr/local, because macOS provides an older sqlite3.

If you need to have sqlite first in your PATH run: echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile

For compilers to find sqlite you may need to set: export LDFLAGS="-L/usr/local/opt/sqlite/lib" export CPPFLAGS="-I/usr/local/opt/sqlite/include"

For pkg-config to find sqlite you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"

==> Summary 🍺 /usr/local/Cellar/sqlite/3.31.1: 11 files, 4MB ==> Installing pipenv dependency: python@3.8 ==> Downloading https://homebrew.bintray.com/bottles/python@3.8-3.8.1.catalina.bottle.tar.gz ==> Downloading from https://akamai.bintray.com/f7/f7150810ab3337f74d8cd5c4d39e3e62e37242f041a45ae01bcba641a3467de8?gda=ex

################################################################## 100.0%

==> Pouring python@3.8-3.8.1.catalina.bottle.tar.gz ==> /usr/local/Cellar/python@3.8/3.8.1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/ ==> /usr/local/Cellar/python@3.8/3.8.1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/ ==> /usr/local/Cellar/python@3.8/3.8.1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/ ==> Caveats Python has been installed as /usr/local/opt/python@3.8/bin/python3

You can install Python packages with /usr/local/opt/python@3.8/bin/pip3 install They will install into the site-package directory /usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages

See: https://docs.brew.sh/Homebrew-and-Python

python@3.8 is keg-only, which means it was not symlinked into /usr/local, because this is an alternate version of another formula.

If you need to have python@3.8 first in your PATH run: echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.bash_profile

For compilers to find python@3.8 you may need to set: export LDFLAGS="-L/usr/local/opt/python@3.8/lib"

For pkg-config to find python@3.8 you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig"

sho-pro:~ owner$ echo 'eval "$(pipenv --completion)"' >> ~/.bash_profile sho-pro:~ owner$ exec $SHELL -l

簡単な使い方

初期化: 目的のディレクトリにて

% pipenv --python /usr/local/opt/python@3.8/bin/python3

インストールした仮想環境に入る

% pipenv shell

ライブラリを追加インストールする

% pipenv install % pipenv install --dev flake8 #開発環境のみで使うライブラリの場合は--devフラグをつける

依存ライブラリのアップデート確認

% pipenv update --outdated

依存ライブラリのアップデート

% pipenv update % pipenv update

セキュリティの脆弱性を確認する

% pipenv check

仮想環境を終了させる

% exit

これがあった方がディレクトリ管理がしやすい。

echo 'export PIPENV_VENV_IN_PROJECT=TRUE' >> ~/.bash_profile

QtDesignerの入手

build-system.fman.io