kaudo@MacBookPro ~ % sudo pip3 install selenium
WARNING: The directory '/Users/kaudo/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting selenium
Downloading selenium-3.141.0-py2.py3-none-any.whl (904 kB)
|████████████████████████████████| 904 kB 550 kB/s
Requirement already satisfied: urllib3 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from selenium) (1.25.10)
Installing collected packages: selenium
Successfully installed selenium-3.141.0
kaudo@MacBookPro ~ %
다른 블로그를 보고(특히 윈도우예제) pip로 인스톨하시는 분들이 있는데,
맥은 파이썬2버전이 원래 깔려있어서 pip3로 설치해야 합니다.
pip로 설치하면 제대로 작동하지 않을 수 있습니다.
파이썬2 셀레니엄 삭제
sudo pip uninstall selenium
파이썬3 셀레니엄 삭제
sudo pip3 uninstall selenium
kaudo@MacBookPro ~ % sudo pip uninstall selenium
WARNING: The directory '/Users/kaudo/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Found existing installation: selenium 3.141.0
Uninstalling selenium-3.141.0:
Would remove:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium-3.141.0.dist-info/*
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/selenium/*
Proceed (y/n)? y
Successfully uninstalled selenium-3.141.0
kaudo@MacBookPro ~ %
[MAC/PYTHON] 맥북에 파이썬 PIP 설치하기, command not found: pip
파이썬 설치하면 PIP를 쓸수있다길래 해봤는데 안되네요.
윈도우는 잘 모르겠지만 맥은 파이썬을 설치한 후에 PIP는 별도로 설치해야하나봅니다.
터미널에서 실행하면 다음과 같이 pip따위는 없다는 오류가 발생합니다.
kaudo@MacBookPro ~ % pip
zsh: command not found: pip
1. curl로 파이썬 파일을 하나 다운받습니다. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
kaudo@MacBookPro ~ % curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1840k 100 1840k 0 0 2115k 0 --:--:-- --:--:-- --:--:-- 2113k
2. 이전에 설치해놓은파이썬3로 다운받은 파이썬 파일을 실행합니다. python3 get-pip.py
kaudo@MacBookPro ~ % pip
Usage:
pip <command> [options]
Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies.
config Manage local and global configuration.
search Search PyPI for packages.
cache Inspect and manage pip's wheel cache.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion.
debug Show information useful for debugging.
help Show help for commands.
General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring environment variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to
WARNING, ERROR, and CRITICAL logging levels).
--log <path> Path to a verbose appending log.
--no-input Disable prompting for input.
--proxy <proxy> Specify a proxy in the form [user:passwd@]proxy.server:port.
--retries <retries> Maximum number of retries each connection should attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup,
(a)bort.
--trusted-host <hostname> Mark this host or host:port pair as trusted, even though it does not have valid or any
HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file containing the private key and the
certificate in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine whether a new version of pip is available for
download. Implied with --no-index.
--no-color Suppress colored output
--no-python-version-warning
Silence deprecation warnings for upcoming unsupported Pythons.
--use-feature <feature> Enable new functionality, that may be backward incompatible.
--use-deprecated <feature> Enable deprecated functionality, that will be removed in the future.