Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


python_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
python_notes [2020/04/09 18:03] juckinspython_notes [2020/11/18 08:58] juckins
Line 1: Line 1:
-==== Python Notes ====+==== Python Install Notes ==== 
 + 
 +__11 Oct 2020__ 
 + 
 +Manually updated chrome to v87. 
 +Ran the following: 
 + 
 +  python3 -m pip list --outdated 
 +   
 +Then ran the following for each <package_name> 
 +  python3 -m pip install --upgrade <package_name> 
 + 
 +__11 Oct 2020__ 
 + 
 +To upgrade pip modules manually when dependencies give an error: 
 +  # python3 -m pip --list outdated 
 +  # python3 -m pip install --upgrade <package1> <package2>  
 +   
 +These are reported as outdated: 
 + 
 +  [root: ~]# python3 -m pip list --outdated 
 +  Package       Version    Latest    Type 
 +  ------------- ---------- --------- ----- 
 +  certifi       2020.4.5.1 2020.6.20 wheel 
 +  idna          2.9        2.10      wheel 
 +  requests      2.23.0     2.24.0    wheel 
 +  selenium-wire 1.0.12     2.1.1     wheel 
 +  setuptools    46.4.0     50.3.0    wheel 
 +  urllib3       1.25.9     1.25.10   wheel 
 +   
 +All upgraded using the command: 
 + 
 +  python3 -m pip install --upgrade <package_name> 
 + 
 + 
 +__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 "CENTOS78-test" first) to fix: 
 + 
 +  # /usr/bin/python3 -m pip uninstall chromedriver-binary 
 +  # /usr/bin/python3 -m pip install chromedriver-binary 
 +  # /usr/bin/python3 -m pip install --upgrade pip 
 +  # find /usr -name "chromedriver" -exec ls -l {} \; 
 +  # chmod 755 /usr/local/lib/python3.6/site-packages/chromedriver_binary/chromedriver 
 + 
 +__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: 
 + 
 +  # /usr/bin/python3 -m pip uninstall chromedriver-binary 
 +  # /usr/bin/python3 -m pip install chromedriver-binary 
 +  # /usr/bin/python3 -m pip install --upgrade pip 
 +  # find /usr -name "chromedriver" -exec ls -l {} \; 
 +  # chmod 755 /usr/local/lib/python3.6/site-packages/chromedriver_binary/chromedriver 
 + 
 +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: 
 + 
 +  # /usr/local/bin/pip3 uninstall chromedriver-binary 
 +  # /usr/local/bin/pip3 install chromedriver-binary 
 +  # /usr/bin/python3 -m pip install --upgrade pip 
 +  # find /usr -name "chromedriver" -exec ls -l {} \; 
 +  # chmod 755 /usr/local/lib/python3.6/site-packages/chromedriver_binary/chromedriver 
 + 
 +Re-ran the cron and script worked. 
 + 
 +Then tried looking at old packages needing an update: 
 + 
 +  # cd /usr/local/bin 
 +  # ./pip3 list --outdated 
 +  # pip_upgrade_outdated
  
 __8 April 2020__ __8 April 2020__
Line 14: Line 97:
   # ./pip3 install --upgrade   # ./pip3 install --upgrade
   # ./pip3 list --outdated   # ./pip3 list --outdated
-  # pip-upgrade-outdated+  # pip_upgrade_outdated
      
   # find /usr -name "chromedriver" -exec ls -l {} \;   # find /usr -name "chromedriver" -exec ls -l {} \;
Line 100: Line 183:
      
   $ pip list   $ pip list
-   
-[[https://docs.python.org/3/howto/logging.html|Logging in python]] 
- 
-  logging.basicConfig(format='%(asctime)s %(message)s', filename=log_file, level=logging.DEBUG) 
-  logging.debug('This message should go to the log file') 
-  logging.info('So should this') 
-  logging.warning('And this, too') 
- 
- 
-[[https://realpython.com/python-pep8/|Write beautiful python code with PEP-8]] 
python_notes.txt · Last modified: 2023/04/05 08:56 by juckins