python_notes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
python_notes [2019/06/08 10:04] – juckins | python_notes [2022/01/20 10:44] – juckins | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== Python Notes ==== | + | ==== Python |
- | Use " | + | __20 Jan 2022__ |
- | # yum install python2-pip | + | Upgraded several python packages. |
- | To list installed python modules: | + | [root@tidewater: |
+ | Package | ||
+ | ------------------- -------------- -------------- ----- | ||
+ | charset-normalizer | ||
+ | chromedriver-binary 96.0.4664.35.0 98.0.4758.48.0 sdist | ||
+ | requests | ||
+ | setuptools | ||
+ | urllib3 | ||
+ | |||
+ | [root@tidewater: | ||
+ | |||
+ | Note: Did not update chromedriver-binary as Chrome is still version 97.0.4692.99 | ||
+ | |||
+ | __16 Nov 2021__ | ||
| | ||
- | $ pip list | + | Upgraded several python packages. |
| | ||
- | Python 3 installation tips: | + | [root@tidewater: |
+ | Package | ||
+ | ------------------- -------------- -------------- ----- | ||
+ | certifi | ||
+ | charset-normalizer | ||
+ | chromedriver-binary 94.0.4606.61.0 96.0.4664.35.0 sdist | ||
+ | idna 3.2 3.3 wheel | ||
+ | Pillow | ||
+ | pytz 2021.1 | ||
+ | setuptools | ||
+ | |||
+ | [root@tidewater: | ||
+ | |||
+ | __29 Sep 2021__ | ||
+ | |||
+ | Upgraded the following python3 packages using the commands listed below: | ||
+ | |||
+ | pip | ||
+ | charset-normalizer | ||
+ | setuptools | ||
+ | urllib3 | ||
+ | chromedriver-binary | ||
+ | |||
+ | Then got the following error message for chromedriver-binary: | ||
+ | |||
+ | selenium.common.exceptions.SessionNotCreatedException: | ||
+ | Current browser version is 94.0.4606.61 with binary path / | ||
+ | |||
+ | So did the following to fix: | ||
+ | |||
+ | python3 -m pip install chromedriver-binary==94.0.4606.61 | ||
+ | find /usr -name " | ||
+ | chmod 755 / | ||
+ | |||
+ | __21 Jul 2021__ | ||
+ | |||
+ | # python3 -m pip list --outdated | ||
+ | Package | ||
+ | ------------------- -------------- -------------- ----- | ||
+ | certifi | ||
+ | chromedriver-binary 91.0.4472.19.0 92.0.4515.43.0 sdist | ||
+ | idna 3.1 3.2 wheel | ||
+ | requests | ||
+ | setuptools | ||
+ | urllib3 | ||
+ | |||
+ | Upgraded all using: | ||
+ | |||
+ | python3 -m pip install --upgrade < | ||
+ | |||
+ | Note on chromedriver-binary...don' | ||
+ | |||
+ | # find /usr -name " | ||
+ | # chmod 755 / | ||
+ | |||
+ | __26 May 2021__ | ||
+ | |||
+ | |||
+ | These packages were outdated: | ||
+ | |||
+ | # python3 -m pip list --outdated | ||
+ | Package | ||
+ | ------------------- -------------- -------------- ----- | ||
+ | chromedriver-binary 90.0.4430.24.0 91.0.4472.19.0 sdist | ||
+ | pip | ||
+ | setuptools | ||
+ | WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available. | ||
+ | You should consider upgrading via the '/ | ||
+ | |||
+ | Upgraded all using: | ||
+ | |||
+ | python3 -m pip install --upgrade < | ||
+ | |||
+ | |||
+ | __15 Apr 2021__ | ||
+ | |||
+ | Updated various python packages, including chromedriver-binary | ||
+ | |||
+ | __3 Mar 2021__ | ||
+ | |||
+ | |||
+ | These packages were outdated: | ||
+ | |||
+ | # python3 -m pip list --outdated | ||
+ | Package | ||
+ | ------------------- -------------- -------------- ----- | ||
+ | certifi | ||
+ | chardet | ||
+ | chromedriver-binary 87.0.4280.20.0 89.0.4389.23.0 sdist | ||
+ | httplib2 | ||
+ | idna 2.10 | ||
+ | PyMySQL | ||
+ | pytz 2020.4 | ||
+ | requests | ||
+ | selenium-wire | ||
+ | setuptools | ||
+ | urllib3 | ||
+ | wheel | ||
+ | |||
+ | Upgraded all using: | ||
+ | |||
+ | python3 -m pip install --upgrade < | ||
+ | |||
+ | <color # | ||
+ | |||
+ | __18 Nov 2020__ | ||
+ | |||
+ | Manually updated chrome to v87. | ||
+ | Ran the following: | ||
+ | |||
+ | python3 -m pip list --outdated | ||
+ | |||
+ | With the resulting list, then ran the following for each < | ||
+ | python3 -m pip install --upgrade < | ||
+ | |||
+ | __11 Oct 2020__ | ||
+ | |||
+ | To upgrade pip modules manually when dependencies give an error: | ||
+ | # python3 -m pip --list outdated | ||
+ | # python3 -m pip install --upgrade < | ||
+ | |||
+ | These are reported as outdated: | ||
+ | |||
+ | [root: ~]# python3 -m pip list --outdated | ||
+ | Package | ||
+ | ------------- ---------- --------- ----- | ||
+ | certifi | ||
+ | idna 2.9 2.10 wheel | ||
+ | requests | ||
+ | selenium-wire 1.0.12 | ||
+ | setuptools | ||
+ | urllib3 | ||
+ | |||
+ | All upgraded using the command: | ||
+ | |||
+ | python3 -m pip install --upgrade < | ||
+ | |||
+ | |||
+ | __9 Oct 2020__ | ||
+ | |||
+ | Updated Chrome via yum to version 86.0.4240.75-1 and now check_envoy.pl fails. | ||
+ | |||
+ | Did the following as root (checked on the VM " | ||
+ | |||
+ | # / | ||
+ | # / | ||
+ | |||
+ | Note: you can also do specific versions of chromedrive-binary: | ||
+ | |||
+ | # python3 -m pip install chromedriver-binary==90.0.4430.24.0 | ||
+ | |||
+ | # / | ||
+ | # find /usr -name " | ||
+ | # chmod 755 / | ||
+ | |||
+ | __6 Oct 2020__ | ||
+ | # python3 -m pip install demjson | ||
+ | # python3 -m pip install wheel | ||
+ | |||
+ | __26 Aug 2020__ | ||
+ | |||
+ | Updated Chrome via yum to version 85.0.4183.83-1 and now check_envoy.pl fails. | ||
+ | |||
+ | Did the following as root to fix: | ||
+ | |||
+ | # / | ||
+ | # / | ||
+ | # / | ||
+ | # find /usr -name " | ||
+ | # chmod 755 / | ||
+ | |||
+ | Re-ran the cron and script worked. | ||
+ | |||
+ | __20 May 2020__ | ||
+ | |||
+ | Updated Chrome via yum to version 83.0.4103.61-1 and now check_envoy.pl fails. | ||
+ | |||
+ | Did the following as root to fix: | ||
+ | |||
+ | # / | ||
+ | # / | ||
+ | # / | ||
+ | # find /usr -name " | ||
+ | # chmod 755 / | ||
+ | |||
+ | Re-ran the cron and script worked. | ||
+ | |||
+ | Then tried looking at old packages needing an update: | ||
+ | |||
+ | # cd / | ||
+ | # ./pip3 list --outdated | ||
+ | # pip_upgrade_outdated | ||
+ | |||
+ | __8 April 2020__ | ||
+ | |||
+ | Upgraded Chrome via yum to version 81.0.4044.92 and now check_envoy.pl fails. | ||
+ | |||
+ | Did the following as root to fix: | ||
+ | |||
+ | # / | ||
+ | # / | ||
+ | # / | ||
+ | |||
+ | # cd / | ||
+ | # ./pip3 install --upgrade | ||
+ | # ./pip3 list --outdated | ||
+ | # pip_upgrade_outdated | ||
+ | |||
+ | # find /usr -name " | ||
+ | |||
+ | / | ||
+ | |||
+ | # chmod 755 / | ||
+ | |||
+ | The pip upgrade moved the astral package to v2.1 which broke sun.py and it needed some major changes. | ||
+ | |||
+ | __11 December 2019__ | ||
+ | |||
+ | Upgraded Chrome via yum to version 79.0.3945.79 and now check_envoy.pl fails. | ||
+ | |||
+ | Did the following as root to fix: | ||
+ | |||
+ | # / | ||
+ | # / | ||
+ | # / | ||
+ | # pip-upgrade-outdated | ||
+ | |||
+ | # find /usr -name " | ||
+ | |||
+ | / | ||
+ | / | ||
+ | |||
+ | # chmod 755 / | ||
+ | |||
+ | Note that both **/ | ||
+ | |||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | With CentOS7.7, python3 can load from base. Do the following to fix previously-installed IUS release: | ||
+ | |||
+ | # yum remove python36u | ||
+ | # yum install python3 | ||
+ | # yum remove ius-release | ||
+ | |||
+ | * Then follow instructions for installing local python packages to ensure all still work. | ||
+ | * If you have pip problems, uninstall/ | ||
+ | * Ensure pip3.6 is in your $PATH or you have a sym link to it (/ | ||
+ | |||
+ | __Install | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
- | * https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/ | + | |
+ | Do some local configuration for my scripts (su - root): | ||
+ | pip3.6 install --upgrade pip | ||
+ | pip3.6 install --upgrade httplib2 | ||
+ | pip3.6 install pymysql | ||
+ | pip3.6 install selenium | ||
+ | pip3.6 install selenium-wire | ||
+ | pip3.6 install chromedriver | ||
+ | pip3.6 install chromedriver_binary | ||
+ | pip3.6 install dictor | ||
+ | pip3.6 install wget | ||
+ | pip3.6 install pip-upgrade-outdated | ||
+ | pip3.6 install pytz | ||
+ | pip3.6 install astral | ||
+ | |||
+ | Note: replace the " | ||
+ | |||
+ | To update all pip packages: | ||
+ | |||
+ | # pip_upgrade_outdated | ||
+ | |||
+ | Note that https://pypi.org/project/pip-upgrade-outdated/ is a good resource to update all PIP packages. | ||
+ | |||
+ | Download and install geckodriver (see https:// | ||
+ | |||
+ | As root, copy geckodriver | ||
+ | |||
+ | Notes at https:// | ||
+ | |||
+ | Notes about [[https:// | ||
Python3.7 on Fedora 28: | Python3.7 on Fedora 28: | ||
Line 19: | Line 311: | ||
* python3.7 get-pip.py | * python3.7 get-pip.py | ||
* python3.7 -m pip install requests | * python3.7 -m pip install requests | ||
+ | |||
+ | Use " | ||
+ | |||
+ | # yum install python2-pip | ||
+ | |||
+ | To list installed python modules: | ||
+ | | ||
+ | $ pip list |
python_notes.txt · Last modified: 2023/04/05 08:56 by juckins