Archive for the ‘Python 3.x’ Category
I put this together to show my students how to simplify writing and testing Python library files. The trick requires that you learn how to set a relative $PYTHONPATH
environment file.
export set PYTHONPATH=./lib |
export set PYTHONPATH=./lib
After setting the $PYTHONPATH
environment variable, connect to Python’s IDLE environment and run the following code:
import os
print(os.environ['PYTHONPATH']) |
import os
print(os.environ['PYTHONPATH'])
It prints the following:
You can also discover all the standard libraries and your $PYTHONPATH
value in your environment with the following command:
for i in sys.path:
print(i) |
for i in sys.path:
print(i)
It prints the following, which lists the one set by the $PYTHONPATH
first:
/home/student/Code/python/path/lib
/usr/lib64/python37.zip
/usr/lib64/python3.7
/usr/lib64/python3.7/lib-dynload
/home/student/.local/lib/python3.7/site-packages
/usr/lib64/python3.7/site-packages
/usr/lib/python3.7/site-packages |
/home/student/Code/python/path/lib
/usr/lib64/python37.zip
/usr/lib64/python3.7
/usr/lib64/python3.7/lib-dynload
/home/student/.local/lib/python3.7/site-packages
/usr/lib64/python3.7/site-packages
/usr/lib/python3.7/site-packages
You create a test my_module.py
library file in the relative ./lib
directory, like the following:
# Define a hello function that accept a name and prints a salutation.
def hello(whom):
return "Hello " + whom + "!" |
# Define a hello function that accept a name and prints a salutation.
def hello(whom):
return "Hello " + whom + "!"
Next, you can create a testlib.py
program:
# Import the hello function into the local namesapce from the my_module.
from my_module import hello
# Call the module hello, which returns a formatted string.
print(hello("Suzie Q")) |
# Import the hello function into the local namesapce from the my_module.
from my_module import hello
# Call the module hello, which returns a formatted string.
print(hello("Suzie Q"))
It imports the hello(whom)
function into the local namespace and then calls the hello(whom)
function with the string literal "Susie"
. It prints:
If you import
the my_module
module, you must refer to the hello(whom)
function by prefacing it with my_module.
, like the following example:
# Import the hello function into the local namesapce from the my_module.
import my_module
# Call the module hello, which returns a formatted string.
print(my_module.hello("Suzie Q")) |
# Import the hello function into the local namesapce from the my_module.
import my_module
# Call the module hello, which returns a formatted string.
print(my_module.hello("Suzie Q"))
A direct import doesn’t add the method to the local namespace. It remains in the my_module
‘s namespace.
It’s probably important to note where my_module.pyc files are written for the those migrating from Python 2.7 to Python 3. In Python 2.7 they would be written to the ./lib
directory, but in Python 3 they’re written to the ./lib/__pycache__
directory.
As always, I hope this helps those who find it and read it.
As I committed to a student, here are sample programs for writing a Python query against the Postgres 11 database. The first one returns rows or tuples. The latter formats the text returned as columns.
If you’re one of many looking for the key psycopg2
driver library, you can find it in most distro repositories as: python3-psycopg2
. You can use dnf
or yum
to install it separately or you can install pgadmin4
, which includes the psycopg2
library.
The first example returns the entire row from a new_hire
table with two rows:
import psycopg2
try:
# Open a connection to the database.
connection = psycopg2.connect( user="student"
, password="student"
, port="5432"
, dbname="videodb")
# Open a cursor.
cursor = connection.cursor()
# Assign a static query.
query = "SELECT * FROM new_hire"
# Parse and execute the query.
cursor.execute(query)
# Fetch all rows from a table.
records = cursor.fetchall()
# Read through and print the rows as tuples.
for row in range(0, len(records)):
print(records[row])
except (Exception, psycopg2.Error) as error :
print("Error while fetching data from PostgreSQL", error)
finally:
# Close the database connection.
if (connection):
cursor.close()
connection.close() |
import psycopg2
try:
# Open a connection to the database.
connection = psycopg2.connect( user="student"
, password="student"
, port="5432"
, dbname="videodb")
# Open a cursor.
cursor = connection.cursor()
# Assign a static query.
query = "SELECT * FROM new_hire"
# Parse and execute the query.
cursor.execute(query)
# Fetch all rows from a table.
records = cursor.fetchall()
# Read through and print the rows as tuples.
for row in range(0, len(records)):
print(records[row])
except (Exception, psycopg2.Error) as error :
print("Error while fetching data from PostgreSQL", error)
finally:
# Close the database connection.
if (connection):
cursor.close()
connection.close()
The first example returns the rows as tuples, which is probably desired if you want to consume the result in another Python program. Here’s the output retrieved:
(1001, 'Malcolm', 'Jacob', 'Lewis', datetime.date(2018, 2, 14))
(1002, 'Henry', None, 'Chabot', datetime.date(1990, 7, 31)) |
(1001, 'Malcolm', 'Jacob', 'Lewis', datetime.date(2018, 2, 14))
(1002, 'Henry', None, 'Chabot', datetime.date(1990, 7, 31))
The second one returns the rows and formats the columns into output for a csv
style file:
import psycopg2
try:
# Open a connection to the database.
connection = psycopg2.connect( user="student"
, password="student"
, port="5432"
, dbname="videodb")
# Open a cursor.
cursor = connection.cursor()
# Assign a static query.
query = "SELECT * FROM new_hire"
# Parse and execute the query.
cursor.execute(query)
# Read through and print the formatted columns of each row.
for (new_hire_id, first_name, middle_name, last_name, hire_date) in cursor:
if (isinstance(middle_name,type(None))):
print("{},'{} {}','{:%d-%b-%Y}'".format(new_hire_id, first_name, last_name, hire_date))
else:
print("{},'{} {} {}','{:%d-%b-%Y}'".format(new_hire_id, first_name, middle_name, last_name, hire_date))
except (Exception, psycopg2.Error) as error :
print("Error while fetching data from PostgreSQL", error)
finally:
# Close the database connection.
if (connection):
cursor.close()
connection.close() |
import psycopg2
try:
# Open a connection to the database.
connection = psycopg2.connect( user="student"
, password="student"
, port="5432"
, dbname="videodb")
# Open a cursor.
cursor = connection.cursor()
# Assign a static query.
query = "SELECT * FROM new_hire"
# Parse and execute the query.
cursor.execute(query)
# Read through and print the formatted columns of each row.
for (new_hire_id, first_name, middle_name, last_name, hire_date) in cursor:
if (isinstance(middle_name,type(None))):
print("{},'{} {}','{:%d-%b-%Y}'".format(new_hire_id, first_name, last_name, hire_date))
else:
print("{},'{} {} {}','{:%d-%b-%Y}'".format(new_hire_id, first_name, middle_name, last_name, hire_date))
except (Exception, psycopg2.Error) as error :
print("Error while fetching data from PostgreSQL", error)
finally:
# Close the database connection.
if (connection):
cursor.close()
connection.close()
The second one returns the rows and formatted columns for a csv
style file:
1001,'Malcolm Jacob Lewis','14-Feb-2018'
1002,'Henry Chabot','31-Jul-1990' |
1001,'Malcolm Jacob Lewis','14-Feb-2018'
1002,'Henry Chabot','31-Jul-1990'
As always, I hope these help those looking for a starting place with Python and Postgres.
While attempting an install of pgAdmin and updating a Fedora 30 environment, I encountered a conflict on the upgrade of MySQL 8.0.17-1 to 8.0.17.2. The community-mysql-8.0.17-2.fc30.x86_64
had conflicts with:
mysql-community-client-8.0.17-1.fc30.x86_64
package
mysql-community-server-8.0.17-1.fc30.x86_64
package
I tried to update the system before install pgadmin4
with the following syntax:
dnf -y update && dnf -y install pgadmin4 |
dnf -y update && dnf -y install pgadmin4
The dnf
utility raise the following MySQL package errors during transaction checking:
Display detailed console log →
Error: Transaction check error:
file /usr/bin/mysql conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysql_config_editor conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqladmin conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlbinlog conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlcheck conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqldump conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlimport conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlpump conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlshow conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlslap conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/ibd2sdi conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/innochecksum conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/my_print_defaults conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/myisam_ftdump conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/myisamchk conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/myisamlog conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/myisampack conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/mysql_secure_installation conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/mysql_ssl_rsa_setup conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/mysql_tzinfo_to_sql conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/mysql_upgrade conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/mysqld_pre_systemd conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/perror conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib/systemd/system/mysqld.service conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib/systemd/system/mysqld@.service conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/adt_null.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/auth_socket.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/component_audit_api_message_emit.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/component_log_filter_dragnet.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/component_log_sink_json.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/component_log_sink_syseventlog.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/component_validate_password.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/connection_control.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/ddl_rewriter.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/group_replication.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/ha_example.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/ha_mock.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/innodb_engine.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/keyring_file.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/keyring_udf.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/libmemcached.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/locking_service.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/mypluglib.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/mysql_clone.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/mysql_no_login.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/rewrite_example.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/rewriter.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/semisync_master.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/semisync_slave.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/validate_password.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/version_token.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/sbin/mysqld conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /var/lib/mysql conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /var/lib/mysql-keyring conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/libmysqlclient.so.21.1.17 conflicts between attempted installs of community-mysql-libs-8.0.17-2.fc30.x86_64 and mysql-community-libs-8.0.17-1.fc30.x86_64 |
Error: Transaction check error:
file /usr/bin/mysql conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysql_config_editor conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqladmin conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlbinlog conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlcheck conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqldump conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlimport conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlpump conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlshow conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/mysqlslap conflicts between attempted installs of community-mysql-8.0.17-2.fc30.x86_64 and mysql-community-client-8.0.17-1.fc30.x86_64
file /usr/bin/ibd2sdi conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/innochecksum conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/my_print_defaults conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/myisam_ftdump conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/myisamchk conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/myisamlog conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/myisampack conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/mysql_secure_installation conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/mysql_ssl_rsa_setup conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/mysql_tzinfo_to_sql conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/mysql_upgrade conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/mysqld_pre_systemd conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/bin/perror conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib/systemd/system/mysqld.service conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib/systemd/system/mysqld@.service conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/adt_null.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/auth_socket.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/component_audit_api_message_emit.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/component_log_filter_dragnet.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/component_log_sink_json.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/component_log_sink_syseventlog.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/component_validate_password.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/connection_control.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/ddl_rewriter.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/group_replication.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/ha_example.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/ha_mock.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/innodb_engine.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/keyring_file.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/keyring_udf.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/libmemcached.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/locking_service.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/mypluglib.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/mysql_clone.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/mysql_no_login.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/rewrite_example.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/rewriter.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/semisync_master.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/semisync_slave.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/validate_password.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/plugin/version_token.so conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/sbin/mysqld conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /var/lib/mysql conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /var/lib/mysql-keyring conflicts between attempted installs of community-mysql-server-8.0.17-2.fc30.x86_64 and mysql-community-server-8.0.17-1.fc30.x86_64
file /usr/lib64/mysql/libmysqlclient.so.21.1.17 conflicts between attempted installs of community-mysql-libs-8.0.17-2.fc30.x86_64 and mysql-community-libs-8.0.17-1.fc30.x86_64
Since I’m not sure what’s wrong or how to fix it, I’ve put it in my queue of things to get to later. However, when I figure it out I’ll update this blog page with the solution or work around. If anybody knows the fix and would like to share, please let me know.
I removed the pending update packages with the following command:
Then, I simply installed pgadmin4
with the following command:
Display detailed console log →
Fedora Modular 30 - x86_64 24 kB/s | 17 kB 00:00
Fedora Modular 30 - x86_64 - Updates 26 kB/s | 15 kB 00:00
Fedora 30 - x86_64 - Updates 39 kB/s | 15 kB 00:00
Fedora 30 - x86_64 31 kB/s | 17 kB 00:00
google-chrome-unstable 12 kB/s | 1.3 kB 00:00
google-chrome 14 kB/s | 1.3 kB 00:00
MongoDB Repository 11 kB/s | 2.5 kB 00:00
MySQL 8.0 Community Server 10 kB/s | 2.5 kB 00:00
MySQL Connectors Community 13 kB/s | 2.5 kB 00:00
MySQL Tools Community 13 kB/s | 2.5 kB 00:00
PostgreSQL 11 30 - x86_64 1.5 kB/s | 3.8 kB 00:02
PostgreSQL 10 30 - x86_64 4.3 kB/s | 3.8 kB 00:00
PostgreSQL 9.6 30 - x86_64 10 kB/s | 3.8 kB 00:00
PostgreSQL 9.5 30 - x86_64 4.7 kB/s | 3.8 kB 00:00
PostgreSQL 9.4 30 - x86_64 8.4 kB/s | 3.8 kB 00:00
Dependencies resolved.
===============================================================================================================================================
Package Architecture Version Repository Size
===============================================================================================================================================
Installing:
pgadmin4 x86_64 4.12-1.f30 pgdg11 11 k
Installing dependencies:
python3-alembic noarch 1.0.10-1.fc30 updates 780 k
python3-paramiko noarch 2.5.0-1.fc30 updates 288 k
python3-sqlalchemy x86_64 1.3.7-1.fc30 updates 1.9 M
python3-bcrypt x86_64 3.1.4-7.fc30 fedora 41 k
python3-blinker noarch 1.4-4.fc30 fedora 113 k
python3-editor noarch 1.0.3-10.fc30 fedora 17 k
python3-flask noarch 1:1.0.2-4.fc30 fedora 154 k
python3-flask-babel noarch 0.11.2-4.fc30 fedora 53 k
python3-flask-babelex noarch 0.9.3-6.fc30 fedora 23 k
python3-flask-gravatar noarch 0.5.0-5.fc30 fedora 18 k
python3-flask-login noarch 0.4.1-5.fc30 fedora 34 k
python3-flask-mail noarch 0.9.1-7.fc30 fedora 22 k
python3-flask-paranoid noarch 0.2.0-6.fc30 fedora 13 k
python3-flask-principal noarch 0.4.0-19.fc30 fedora 19 k
python3-flask-security noarch 3.0.0-5.fc30 fedora 82 k
python3-flask-sqlalchemy noarch 2.3.2-4.fc30 fedora 116 k
python3-flask-wtf noarch 0.14.2-4.fc30 fedora 67 k
python3-htmlmin noarch 0.1.12-7.git220b1d1.fc30 fedora 61 k
python3-itsdangerous noarch 0.24-16.fc30 fedora 28 k
python3-linecache2 noarch 1.0.0-18.fc30 fedora 17 k
python3-mod_wsgi x86_64 4.6.4-3.fc30 fedora 5.6 M
python3-passlib noarch 1.7.1-2.fc30 fedora 741 k
python3-pynacl x86_64 1.3.0-1.fc30 fedora 96 k
python3-speaklater noarch 1.3-15.fc30 fedora 15 k
python3-sqlparse noarch 0.2.4-5.fc30 fedora 79 k
python3-traceback2 noarch 1.4.0-19.fc30 fedora 23 k
python3-unittest2 noarch 1.1.0-16.fc30 fedora 183 k
python3-werkzeug noarch 0.14.1-7.fc30 fedora 465 k
python3-wtforms noarch 2.2.1-4.fc30 fedora 188 k
pgadmin4-docs noarch 4.12-1.f30 pgdg11 32 M
pgadmin4-python3-flask-htmlmin noarch 1.5.0-1.f30 pgdg11 13 k
pgadmin4-python3-flask-migrate noarch 2.4.0-1.f30 pgdg11 28 k
pgadmin4-python3-psutil x86_64 5.5.1-1.f30 pgdg11 375 k
pgadmin4-python3-six noarch 1.12.0-3.f30 pgdg11 35 k
pgadmin4-python3-sshtunnel noarch 0.1.4-1.f30 pgdg11 46 k
pgadmin4-python3-werkzeug noarch 0.15.4-1.f30 pgdg11 463 k
pgadmin4-pytz noarch 2018.9-1.f30 pgdg11 52 k
pgadmin4-web noarch 4.12-1.f30 pgdg11 5.4 M
python3-psycopg2 x86_64 2.8.3-1.f30 pgdg11 168 k
Transaction Summary
===============================================================================================================================================
Install 40 Packages
Total download size: 50 M
Installed size: 109 M
Downloading Packages:
(1/40): python3-paramiko-2.5.0-1.fc30.noarch.rpm 179 kB/s | 288 kB 00:01
(2/40): python3-alembic-1.0.10-1.fc30.noarch.rpm 401 kB/s | 780 kB 00:01
(3/40): python3-sqlalchemy-1.3.7-1.fc30.x86_64.rpm 927 kB/s | 1.9 MB 00:02
(4/40): python3-bcrypt-3.1.4-7.fc30.x86_64.rpm 47 kB/s | 41 kB 00:00
(5/40): python3-flask-1.0.2-4.fc30.noarch.rpm 697 kB/s | 154 kB 00:00
(6/40): python3-editor-1.0.3-10.fc30.noarch.rpm 26 kB/s | 17 kB 00:00
(7/40): python3-blinker-1.4-4.fc30.noarch.rpm 128 kB/s | 113 kB 00:00
(8/40): python3-flask-babel-0.11.2-4.fc30.noarch.rpm 435 kB/s | 53 kB 00:00
(9/40): python3-flask-babelex-0.9.3-6.fc30.noarch.rpm 139 kB/s | 23 kB 00:00
(10/40): python3-flask-gravatar-0.5.0-5.fc30.noarch.rpm 175 kB/s | 18 kB 00:00
(11/40): python3-flask-login-0.4.1-5.fc30.noarch.rpm 172 kB/s | 34 kB 00:00
(12/40): python3-flask-mail-0.9.1-7.fc30.noarch.rpm 210 kB/s | 22 kB 00:00
(13/40): python3-flask-paranoid-0.2.0-6.fc30.noarch.rpm 64 kB/s | 13 kB 00:00
(14/40): python3-flask-principal-0.4.0-19.fc30.noarch.rpm 172 kB/s | 19 kB 00:00
(15/40): python3-flask-security-3.0.0-5.fc30.noarch.rpm 379 kB/s | 82 kB 00:00
(16/40): python3-flask-sqlalchemy-2.3.2-4.fc30.noarch.rpm 534 kB/s | 116 kB 00:00
(17/40): python3-flask-wtf-0.14.2-4.fc30.noarch.rpm 295 kB/s | 67 kB 00:00
(18/40): python3-htmlmin-0.1.12-7.git220b1d1.fc30.noarch.rpm 290 kB/s | 61 kB 00:00
(19/40): python3-itsdangerous-0.24-16.fc30.noarch.rpm 253 kB/s | 28 kB 00:00
(20/40): python3-linecache2-1.0.0-18.fc30.noarch.rpm 87 kB/s | 17 kB 00:00
(21/40): python3-pynacl-1.3.0-1.fc30.x86_64.rpm 152 kB/s | 96 kB 00:00
(22/40): python3-passlib-1.7.1-2.fc30.noarch.rpm 897 kB/s | 741 kB 00:00
(23/40): python3-mod_wsgi-4.6.4-3.fc30.x86_64.rpm 4.8 MB/s | 5.6 MB 00:01
(24/40): python3-speaklater-1.3-15.fc30.noarch.rpm 34 kB/s | 15 kB 00:00
(25/40): python3-sqlparse-0.2.4-5.fc30.noarch.rpm 242 kB/s | 79 kB 00:00
(26/40): python3-traceback2-1.4.0-19.fc30.noarch.rpm 211 kB/s | 23 kB 00:00
(27/40): python3-unittest2-1.1.0-16.fc30.noarch.rpm 785 kB/s | 183 kB 00:00
(28/40): python3-werkzeug-0.14.1-7.fc30.noarch.rpm 1.0 MB/s | 465 kB 00:00
(29/40): python3-wtforms-2.2.1-4.fc30.noarch.rpm 574 kB/s | 188 kB 00:00
(30/40): pgadmin4-4.12-1.f30.x86_64.rpm 12 kB/s | 11 kB 00:00
(31/40): pgadmin4-python3-flask-htmlmin-1.5.0-1.f30.noarch.rpm 15 kB/s | 13 kB 00:00
(32/40): pgadmin4-python3-flask-migrate-2.4.0-1.f30.noarch.rpm 68 kB/s | 28 kB 00:00
(33/40): pgadmin4-python3-six-1.12.0-3.f30.noarch.rpm 165 kB/s | 35 kB 00:00
(34/40): pgadmin4-python3-sshtunnel-0.1.4-1.f30.noarch.rpm 215 kB/s | 46 kB 00:00
(35/40): pgadmin4-python3-psutil-5.5.1-1.f30.x86_64.rpm 343 kB/s | 375 kB 00:01
(36/40): pgadmin4-pytz-2018.9-1.f30.noarch.rpm 242 kB/s | 52 kB 00:00
(37/40): pgadmin4-python3-werkzeug-0.15.4-1.f30.noarch.rpm 234 kB/s | 463 kB 00:01
(38/40): python3-psycopg2-2.8.3-1.f30.x86_64.rpm 263 kB/s | 168 kB 00:00
(39/40): pgadmin4-web-4.12-1.f30.noarch.rpm 1.1 MB/s | 5.4 MB 00:04
(40/40): pgadmin4-docs-4.12-1.f30.noarch.rpm 1.2 MB/s | 32 MB 00:26
-----------------------------------------------------------------------------------------------------------------------------------------------
Total 1.5 MB/s | 50 MB 00:32
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-speaklater-1.3-15.fc30.noarch 1/40
Installing : python3-itsdangerous-0.24-16.fc30.noarch 2/40
Installing : python3-blinker-1.4-4.fc30.noarch 3/40
Installing : python3-sqlalchemy-1.3.7-1.fc30.x86_64 4/40
Installing : python3-wtforms-2.2.1-4.fc30.noarch 5/40
Installing : python3-passlib-1.7.1-2.fc30.noarch 6/40
Installing : python3-psycopg2-2.8.3-1.f30.x86_64 7/40
Installing : pgadmin4-pytz-2018.9-1.f30.noarch 8/40
Installing : pgadmin4-python3-werkzeug-0.15.4-1.f30.noarch 9/40
Installing : pgadmin4-python3-six-1.12.0-3.f30.noarch 10/40
Installing : pgadmin4-python3-psutil-5.5.1-1.f30.x86_64 11/40
Installing : pgadmin4-docs-4.12-1.f30.noarch 12/40
Installing : python3-werkzeug-0.14.1-7.fc30.noarch 13/40
Installing : python3-flask-1:1.0.2-4.fc30.noarch 14/40
Installing : python3-flask-babel-0.11.2-4.fc30.noarch 15/40
Installing : python3-flask-babelex-0.9.3-6.fc30.noarch 16/40
Installing : python3-flask-login-0.4.1-5.fc30.noarch 17/40
Installing : python3-flask-mail-0.9.1-7.fc30.noarch 18/40
Installing : python3-flask-principal-0.4.0-19.fc30.noarch 19/40
Installing : python3-flask-wtf-0.14.2-4.fc30.noarch 20/40
Installing : python3-flask-security-3.0.0-5.fc30.noarch 21/40
Installing : python3-flask-gravatar-0.5.0-5.fc30.noarch 22/40
Installing : python3-flask-paranoid-0.2.0-6.fc30.noarch 23/40
Installing : python3-flask-sqlalchemy-2.3.2-4.fc30.noarch 24/40
Installing : pgadmin4-python3-flask-migrate-2.4.0-1.f30.noarch 25/40
Installing : python3-sqlparse-0.2.4-5.fc30.noarch 26/40
Installing : python3-pynacl-1.3.0-1.fc30.x86_64 27/40
Installing : python3-mod_wsgi-4.6.4-3.fc30.x86_64 28/40
Installing : python3-linecache2-1.0.0-18.fc30.noarch 29/40
Installing : python3-traceback2-1.4.0-19.fc30.noarch 30/40
Installing : python3-unittest2-1.1.0-16.fc30.noarch 31/40
Installing : python3-htmlmin-0.1.12-7.git220b1d1.fc30.noarch 32/40
Installing : pgadmin4-python3-flask-htmlmin-1.5.0-1.f30.noarch 33/40
Installing : python3-editor-1.0.3-10.fc30.noarch 34/40
Installing : python3-alembic-1.0.10-1.fc30.noarch 35/40
Installing : python3-bcrypt-3.1.4-7.fc30.x86_64 36/40
Installing : python3-paramiko-2.5.0-1.fc30.noarch 37/40
Installing : pgadmin4-python3-sshtunnel-0.1.4-1.f30.noarch 38/40
Installing : pgadmin4-web-4.12-1.f30.noarch 39/40
Installing : pgadmin4-4.12-1.f30.x86_64 40/40
Running scriptlet: pgadmin4-4.12-1.f30.x86_64 40/40
Verifying : python3-alembic-1.0.10-1.fc30.noarch 1/40
Verifying : python3-paramiko-2.5.0-1.fc30.noarch 2/40
Verifying : python3-sqlalchemy-1.3.7-1.fc30.x86_64 3/40
Verifying : python3-bcrypt-3.1.4-7.fc30.x86_64 4/40
Verifying : python3-blinker-1.4-4.fc30.noarch 5/40
Verifying : python3-editor-1.0.3-10.fc30.noarch 6/40
Verifying : python3-flask-1:1.0.2-4.fc30.noarch 7/40
Verifying : python3-flask-babel-0.11.2-4.fc30.noarch 8/40
Verifying : python3-flask-babelex-0.9.3-6.fc30.noarch 9/40
Verifying : python3-flask-gravatar-0.5.0-5.fc30.noarch 10/40
Verifying : python3-flask-login-0.4.1-5.fc30.noarch 11/40
Verifying : python3-flask-mail-0.9.1-7.fc30.noarch 12/40
Verifying : python3-flask-paranoid-0.2.0-6.fc30.noarch 13/40
Verifying : python3-flask-principal-0.4.0-19.fc30.noarch 14/40
Verifying : python3-flask-security-3.0.0-5.fc30.noarch 15/40
Verifying : python3-flask-sqlalchemy-2.3.2-4.fc30.noarch 16/40
Verifying : python3-flask-wtf-0.14.2-4.fc30.noarch 17/40
Verifying : python3-htmlmin-0.1.12-7.git220b1d1.fc30.noarch 18/40
Verifying : python3-itsdangerous-0.24-16.fc30.noarch 19/40
Verifying : python3-linecache2-1.0.0-18.fc30.noarch 20/40
Verifying : python3-mod_wsgi-4.6.4-3.fc30.x86_64 21/40
Verifying : python3-passlib-1.7.1-2.fc30.noarch 22/40
Verifying : python3-pynacl-1.3.0-1.fc30.x86_64 23/40
Verifying : python3-speaklater-1.3-15.fc30.noarch 24/40
Verifying : python3-sqlparse-0.2.4-5.fc30.noarch 25/40
Verifying : python3-traceback2-1.4.0-19.fc30.noarch 26/40
Verifying : python3-unittest2-1.1.0-16.fc30.noarch 27/40
Verifying : python3-werkzeug-0.14.1-7.fc30.noarch 28/40
Verifying : python3-wtforms-2.2.1-4.fc30.noarch 29/40
Verifying : pgadmin4-4.12-1.f30.x86_64 30/40
Verifying : pgadmin4-docs-4.12-1.f30.noarch 31/40
Verifying : pgadmin4-python3-flask-htmlmin-1.5.0-1.f30.noarch 32/40
Verifying : pgadmin4-python3-flask-migrate-2.4.0-1.f30.noarch 33/40
Verifying : pgadmin4-python3-psutil-5.5.1-1.f30.x86_64 34/40
Verifying : pgadmin4-python3-six-1.12.0-3.f30.noarch 35/40
Verifying : pgadmin4-python3-sshtunnel-0.1.4-1.f30.noarch 36/40
Verifying : pgadmin4-python3-werkzeug-0.15.4-1.f30.noarch 37/40
Verifying : pgadmin4-pytz-2018.9-1.f30.noarch 38/40
Verifying : pgadmin4-web-4.12-1.f30.noarch 39/40
Verifying : python3-psycopg2-2.8.3-1.f30.x86_64 40/40
Installed:
pgadmin4-4.12-1.f30.x86_64 python3-alembic-1.0.10-1.fc30.noarch
python3-paramiko-2.5.0-1.fc30.noarch python3-sqlalchemy-1.3.7-1.fc30.x86_64
python3-bcrypt-3.1.4-7.fc30.x86_64 python3-blinker-1.4-4.fc30.noarch
python3-editor-1.0.3-10.fc30.noarch python3-flask-1:1.0.2-4.fc30.noarch
python3-flask-babel-0.11.2-4.fc30.noarch python3-flask-babelex-0.9.3-6.fc30.noarch
python3-flask-gravatar-0.5.0-5.fc30.noarch python3-flask-login-0.4.1-5.fc30.noarch
python3-flask-mail-0.9.1-7.fc30.noarch python3-flask-paranoid-0.2.0-6.fc30.noarch
python3-flask-principal-0.4.0-19.fc30.noarch python3-flask-security-3.0.0-5.fc30.noarch
python3-flask-sqlalchemy-2.3.2-4.fc30.noarch python3-flask-wtf-0.14.2-4.fc30.noarch
python3-htmlmin-0.1.12-7.git220b1d1.fc30.noarch python3-itsdangerous-0.24-16.fc30.noarch
python3-linecache2-1.0.0-18.fc30.noarch python3-mod_wsgi-4.6.4-3.fc30.x86_64
python3-passlib-1.7.1-2.fc30.noarch python3-pynacl-1.3.0-1.fc30.x86_64
python3-speaklater-1.3-15.fc30.noarch python3-sqlparse-0.2.4-5.fc30.noarch
python3-traceback2-1.4.0-19.fc30.noarch python3-unittest2-1.1.0-16.fc30.noarch
python3-werkzeug-0.14.1-7.fc30.noarch python3-wtforms-2.2.1-4.fc30.noarch
pgadmin4-docs-4.12-1.f30.noarch pgadmin4-python3-flask-htmlmin-1.5.0-1.f30.noarch
pgadmin4-python3-flask-migrate-2.4.0-1.f30.noarch pgadmin4-python3-psutil-5.5.1-1.f30.x86_64
pgadmin4-python3-six-1.12.0-3.f30.noarch pgadmin4-python3-sshtunnel-0.1.4-1.f30.noarch
pgadmin4-python3-werkzeug-0.15.4-1.f30.noarch pgadmin4-pytz-2018.9-1.f30.noarch
pgadmin4-web-4.12-1.f30.noarch python3-psycopg2-2.8.3-1.f30.x86_64
Complete!
The pgadmin4
configuration instructions can be found for several Linux versions at Josphat Mutai’s Computing for Geeks web page. On Fedora 30, you need to do the following:
- Install, start, and enable Apache as the
httpd
service unless you already have done that.
- Copy the
/etc/httpd/conf.d/pgadmin4.conf.sample
file to /etc/httpd/conf.d/pgadmin4.conf
, which is a new file.
- Restart the
httpd
service to incorporate the pgadmin4
configuration file.
After that, you create the following new directories as the root
or sudo
user:
/var/lib/pgadmin4
/var/log/pgadmin4
You can make both directories with a single mkdir
command, like:
mkdir -p /var/lib/pgadmin4 /var/log/pgadmin4 |
mkdir -p /var/lib/pgadmin4 /var/log/pgadmin4
As the root
or sudo
user, change the ownership of these two directories to the apache
user with the following syntax:
chown -R apache:apache /var/lib/pgadmin4 /var/log/pgadmin4 |
chown -R apache:apache /var/lib/pgadmin4 /var/log/pgadmin4
You add the following four statements to the config_distro.py
file in the /usr/lib/python3.7/site-packages/pgadmin4-web
directory as the root
or sudo
user:
LOG_FILE = '/var/log/pgadmin4/pgadmin4.log'
SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
STORAGE_DIR = '/var/lib/pgadmin4/storage' |
LOG_FILE = '/var/log/pgadmin4/pgadmin4.log'
SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
STORAGE_DIR = '/var/lib/pgadmin4/storage'
You need to setup the pgadmin user with the following python3 command:
python3 /usr/lib/python3.7/site-packages/pgadmin4-web/setup.py |
python3 /usr/lib/python3.7/site-packages/pgadmin4-web/setup.py
Enter the following values, a real email address and a password twice:
NOTE: Configuring authentication for SERVER mode.
Enter the email address and password to use for the initial pgAdmin user account:
Email address: admin@example.com
Password: your_password
Retype password: your_password
pgAdmin 4 - Application Initialisation
====================================== |
NOTE: Configuring authentication for SERVER mode.
Enter the email address and password to use for the initial pgAdmin user account:
Email address: admin@example.com
Password: your_password
Retype password: your_password
pgAdmin 4 - Application Initialisation
======================================
Assuming you have an enabled firewall, you need to issue the following two commands as the root
or sudo
user:
rirewall-cmd --permanent --add-service=http
firewall-cmd --reload |
rirewall-cmd --permanent --add-service=http
firewall-cmd --reload
You invoke pgAdmin4 from within a browser window with the following URL for a stand alone workstation (for a workstation on a DNS network you would enter pgadmin.domain.domain_type
in lieu of localhost):
pgadmin/localhost/pgadmin4 |
pgadmin/localhost/pgadmin4
You most likely will encounter an Internal Server Error, the recommended fix is reputed to be:
ausearch -c 'httpd' --raw | audit2allow -M my-httpd
semodule -X 300 -i my-httpd.pp |
ausearch -c 'httpd' --raw | audit2allow -M my-httpd
semodule -X 300 -i my-httpd.pp
It didn’t work for me. At the end of the process, I have an Internal Server Error. It is something that I’ll try to fix next. The actual error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log. |
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
If somebody figures out the last step before I do, that’s great. Let me and everybody else know the mystery.
On a positive note, the pgadmin4 package provided the psycopg2
library. I had looked for it as a psycopg2
package but it is in python3-psycopg2
package.
It seemed opportune to add Django to the Fedora 30 instance that I build and maintain for my students. Here are the instructions, which I developed with the prior Fedora 28/29 instructions.
- Check your Python3 installation with the following command:
It should return this but if it doesn’t you should install python3
:
- Check whether
pip3
is installation by installing it when its not:
sudo def -y install python3-php |
sudo def -y install python3-php
It should return:
Last metadata expiration check: 0:44:52 ago on Tue 10 Sep 2019 11:02:33 AM MDT.
Package python3-pip-19.0.3-3.fc30.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete! |
Last metadata expiration check: 0:44:52 ago on Tue 10 Sep 2019 11:02:33 AM MDT.
Package python3-pip-19.0.3-3.fc30.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
- Check whether
Django
is installation by installing it when its not with pip3
installation utility:
sudo pip3 install --user Django |
sudo pip3 install --user Django
It should return the following if installed:
Requirement already satisfied: Django in /usr/lib/python3.7/site-packages (2.1.10)
Requirement already satisfied: pytz in /usr/lib/python3.7/site-packages (from Django) (2018.5) |
Requirement already satisfied: Django in /usr/lib/python3.7/site-packages (2.1.10)
Requirement already satisfied: pytz in /usr/lib/python3.7/site-packages (from Django) (2018.5)
- Check your
django-admin
account location with the which
utility:
It should return the following on Fedora 30 when installed:
- Create a Django test application with the
django-admin
utility by creating a project directory. My directory is a bit deep. For reference, it is:
/home/student/Code/python/django/projects |
/home/student/Code/python/django/projects
Change to that projects directory, and run the following command:
django-admin startproject test_app |
django-admin startproject test_app
After that command change directory with the cd
command into the test_app
subdirectory in your projects
directory. Run the manage.py program with the following command:
python3 manage.py migrate |
python3 manage.py migrate
You should see the following:
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying admin.0003_logentry_add_action_flag_choices... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
Applying sessions.0001_initial... OK |
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying admin.0003_logentry_add_action_flag_choices... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
Applying sessions.0001_initial... OK
Next, your would create an admin
account. You’re done.
Somebody asked me how to expand a prior example with the static variables so that it took arguments at the command line for the variables. This example uses Python 3 new features in the datetime
package.
There’s a small trick converting the string
arguments to date
data types. Here’s a quick example that shows you how to convert the argument list into individual date
data type variables:
#!/usr/bin/python3
# include standard modules
import sys
from datetime import datetime
# Capture argument list.
fullCmdArguments = sys.argv
# Assignable variables.
beginDate = ""
endDate = ""
# Assign argument list to variable.
argumentList = fullCmdArguments[1:]
# Enumerate through the argument list where beginDate precedes endDate as strings.
try:
for i, s in enumerate(argumentList):
if (i == 0):
beginDate = datetime.date(datetime.fromisoformat(s))
elif (i == 1):
endDate = datetime.date(datetime.fromisoformat(s))
except ValueError:
print("One of the first two arguments is not a valid date (YYYY-MM-DD).")
# Print the processed values and types.
print("Begin Date: [",beginDate,"][",type(beginDate),"]")
print("End Date: [",endDate,"][",type(endDate),"]") |
#!/usr/bin/python3
# include standard modules
import sys
from datetime import datetime
# Capture argument list.
fullCmdArguments = sys.argv
# Assignable variables.
beginDate = ""
endDate = ""
# Assign argument list to variable.
argumentList = fullCmdArguments[1:]
# Enumerate through the argument list where beginDate precedes endDate as strings.
try:
for i, s in enumerate(argumentList):
if (i == 0):
beginDate = datetime.date(datetime.fromisoformat(s))
elif (i == 1):
endDate = datetime.date(datetime.fromisoformat(s))
except ValueError:
print("One of the first two arguments is not a valid date (YYYY-MM-DD).")
# Print the processed values and types.
print("Begin Date: [",beginDate,"][",type(beginDate),"]")
print("End Date: [",endDate,"][",type(endDate),"]")
Assume you call this arguments.py
. Then, you call it with valid conforming date format value like the following command-line example:
./arguments.py 2001-01-01 2003-12-31 |
./arguments.py 2001-01-01 2003-12-31
It returns the arguments after they have been converted to date
data types. The results should look like this:
Begin Date: 1991-01-01 [ <class 'datetime.date'> ]
End Date: 2004-12-31 [ <class 'datetime.date'> ] |
Begin Date: 1991-01-01 [ <class 'datetime.date'> ]
End Date: 2004-12-31 [ <class 'datetime.date'> ]
The next Python example accepts dynamic arguments at the command line to query the MySQL database:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
| #!/usr/bin/python3
# Import the library.
import sys
import mysql.connector
from datetime import datetime
from datetime import date
from mysql.connector import errorcode
# Capture argument list.
fullCmdArguments = sys.argv
# Assignable variables.
start_date = ""
end_date = ""
# Assign argument list to variable.
argumentList = fullCmdArguments[1:]
# Check and process argument list.
# ============================================================
# If there are less than two arguments provide default values.
# Else enumerate and convert strings to dates.
# ============================================================
if (len(argumentList) < 2):
# Set a default start date.
if (isinstance(start_date,str)):
start_date = date(1980, 1, 1)
# Set the default end date.
if (isinstance(end_date,str)):
end_date = datetime.date(datetime.today())
else:
# Enumerate through the argument list where beginDate precedes endDate as strings.
try:
for i, s in enumerate(argumentList):
if (i == 0):
start_date = datetime.date(datetime.fromisoformat(s))
elif (i == 1):
end_date = datetime.date(datetime.fromisoformat(s))
except ValueError:
print("One of the first two arguments is not a valid date (YYYY-MM-DD).")
# Attempt the query.
# ============================================================
# Use a try-catch block to manage the connection.
# ============================================================
try:
# Open connection.
cnx = mysql.connector.connect(user='student', password='student',
host='127.0.0.1',
database='studentdb')
# Create cursor.
cursor = cnx.cursor()
# Set the query statement.
query = ("SELECT CASE "
" WHEN item_subtitle IS NULL THEN item_title "
" ELSE CONCAT(item_title,': ',item_subtitle) "
" END AS title, "
"release_date "
"FROM item "
"WHERE release_date BETWEEN %s AND %s "
"ORDER BY item_title")
# Execute cursor.
cursor.execute(query, (start_date, end_date))
# Display the rows returned by the query.
for (item_name, release_date) in cursor:
print("{}, {:%d-%b-%Y}".format(item_name, release_date))
# Handle exception and close connection.
# ============================================================
except mysql.connector.Error as e:
if e.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif e.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print("Error code:", e.errno) # error number
print("SQLSTATE value:", e.sqlstate) # SQLSTATE value
print("Error message:", e.msg) # error message
# Close the connection when the try block completes.
finally:
cnx.close() |
#!/usr/bin/python3
# Import the library.
import sys
import mysql.connector
from datetime import datetime
from datetime import date
from mysql.connector import errorcode
# Capture argument list.
fullCmdArguments = sys.argv
# Assignable variables.
start_date = ""
end_date = ""
# Assign argument list to variable.
argumentList = fullCmdArguments[1:]
# Check and process argument list.
# ============================================================
# If there are less than two arguments provide default values.
# Else enumerate and convert strings to dates.
# ============================================================
if (len(argumentList) < 2):
# Set a default start date.
if (isinstance(start_date,str)):
start_date = date(1980, 1, 1)
# Set the default end date.
if (isinstance(end_date,str)):
end_date = datetime.date(datetime.today())
else:
# Enumerate through the argument list where beginDate precedes endDate as strings.
try:
for i, s in enumerate(argumentList):
if (i == 0):
start_date = datetime.date(datetime.fromisoformat(s))
elif (i == 1):
end_date = datetime.date(datetime.fromisoformat(s))
except ValueError:
print("One of the first two arguments is not a valid date (YYYY-MM-DD).")
# Attempt the query.
# ============================================================
# Use a try-catch block to manage the connection.
# ============================================================
try:
# Open connection.
cnx = mysql.connector.connect(user='student', password='student',
host='127.0.0.1',
database='studentdb')
# Create cursor.
cursor = cnx.cursor()
# Set the query statement.
query = ("SELECT CASE "
" WHEN item_subtitle IS NULL THEN item_title "
" ELSE CONCAT(item_title,': ',item_subtitle) "
" END AS title, "
"release_date "
"FROM item "
"WHERE release_date BETWEEN %s AND %s "
"ORDER BY item_title")
# Execute cursor.
cursor.execute(query, (start_date, end_date))
# Display the rows returned by the query.
for (item_name, release_date) in cursor:
print("{}, {:%d-%b-%Y}".format(item_name, release_date))
# Handle exception and close connection.
# ============================================================
except mysql.connector.Error as e:
if e.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif e.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print("Error code:", e.errno) # error number
print("SQLSTATE value:", e.sqlstate) # SQLSTATE value
print("Error message:", e.msg) # error message
# Close the connection when the try block completes.
finally:
cnx.close()
You can call the python-mysql-query.py
program with the following syntax:
./python-mysql-query.py 2001-01-01 2003-12-31 |
./python-mysql-query.py 2001-01-01 2003-12-31
It returns the films between 1 Jan 2001 and 31 Dec 2003, like this:
Clear and Present Danger: Special Collector's Edition, 06-May-2003
Die Another Day: 2-Disc Ultimate Version, 03-Jun-2003
Die Another Day, 03-Jun-2003
Die Another Day, 03-Jun-2003
Golden Eye, 03-Jun-2003
Golden Eye: Special Edition, 03-Jun-2003
Harry Potter and the Chamber of Secrets, 28-May-2002
Harry Potter and the Chamber of Secrets: Two-Disc Special Edition, 28-May-2002
Harry Potter and the Sorcerer's Stone, 28-May-2002
Harry Potter and the Sorcerer's Stone: Two-Disc Special Edition, 28-May-2002
Harry Potter and the Sorcerer's Stone: Full Screen Edition, 28-May-2002
MarioKart: Double Dash, 17-Nov-2003
Pirates of the Caribbean, 30-Jun-2003
RoboCop, 24-Jul-2003
Splinter Cell: Chaos Theory, 08-Apr-2003
Star Wars II: Attack of the Clones, 16-May-2002
Star Wars II: Attack of the Clones, 16-May-2002
The Chronicles of Narnia: The Lion, the Witch and the Wardrobe, 30-Jun-2003
The Chronicles of Narnia: The Lion, the Witch and the Wardrobe, 16-May-2002 |
Clear and Present Danger: Special Collector's Edition, 06-May-2003
Die Another Day: 2-Disc Ultimate Version, 03-Jun-2003
Die Another Day, 03-Jun-2003
Die Another Day, 03-Jun-2003
Golden Eye, 03-Jun-2003
Golden Eye: Special Edition, 03-Jun-2003
Harry Potter and the Chamber of Secrets, 28-May-2002
Harry Potter and the Chamber of Secrets: Two-Disc Special Edition, 28-May-2002
Harry Potter and the Sorcerer's Stone, 28-May-2002
Harry Potter and the Sorcerer's Stone: Two-Disc Special Edition, 28-May-2002
Harry Potter and the Sorcerer's Stone: Full Screen Edition, 28-May-2002
MarioKart: Double Dash, 17-Nov-2003
Pirates of the Caribbean, 30-Jun-2003
RoboCop, 24-Jul-2003
Splinter Cell: Chaos Theory, 08-Apr-2003
Star Wars II: Attack of the Clones, 16-May-2002
Star Wars II: Attack of the Clones, 16-May-2002
The Chronicles of Narnia: The Lion, the Witch and the Wardrobe, 30-Jun-2003
The Chronicles of Narnia: The Lion, the Witch and the Wardrobe, 16-May-2002
As always, I hope this helps somebody who wants to learn how to use Python with the MySQL database.
While building my student image on Fedora 30, I installed the MySQL PHP Connector (php-mysqlndrp) but neglected to install the Python Connector. This adds the installation and basic test of the Python Connector to the original blog post.
You use the following command with a wildcard as a privileged user. The wildcard is necessary because you need to load two libraries to support Python 2.7 and 3.7, which are installed on Fedora 30. You also need to be the root user or a user that is found in the sudoer’s list:
yum install -y mysql-connector-python* |
yum install -y mysql-connector-python*
Display detailed console log →
Last metadata expiration check: 0:35:46 ago on Tue 20 Aug 2019 05:36:29 PM MDT.
Dependencies resolved.
=====================================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================================
Installing:
mysql-connector-python x86_64 8.0.17-1.fc30 mysql-connectors-community 435 k
mysql-connector-python-cext x86_64 8.0.17-1.fc30 mysql-connectors-community 7.7 M
mysql-connector-python3 x86_64 8.0.17-1.fc30 mysql-connectors-community 429 k
mysql-connector-python3-cext x86_64 8.0.17-1.fc30 mysql-connectors-community 7.7 M
Installing dependencies:
python2-protobuf noarch 3.6.1-3.fc30 fedora 563 k
python3-protobuf noarch 3.6.1-3.fc30 fedora 568 k
Transaction Summary
=====================================================================================================================================
Install 6 Packages
Total download size: 17 M
Installed size: 89 M
Downloading Packages:
(1/6): python3-protobuf-3.6.1-3.fc30.noarch.rpm 1.0 MB/s | 568 kB 00:00
(2/6): python2-protobuf-3.6.1-3.fc30.noarch.rpm 994 kB/s | 563 kB 00:00
(3/6): mysql-connector-python-8.0.17-1.fc30.x86_64.rpm 481 kB/s | 435 kB 00:00
(4/6): mysql-connector-python3-8.0.17-1.fc30.x86_64.rpm 612 kB/s | 429 kB 00:00
(5/6): mysql-connector-python-cext-8.0.17-1.fc30.x86_64.rpm 3.8 MB/s | 7.7 MB 00:02
(6/6): mysql-connector-python3-cext-8.0.17-1.fc30.x86_64.rpm 4.2 MB/s | 7.7 MB 00:01
-------------------------------------------------------------------------------------------------------------------------------------
Total 5.4 MB/s | 17 MB 00:03
warning: /var/cache/dnf/mysql-connectors-community-8bcc2bd350b53f70/packages/mysql-connector-python-8.0.17-1.fc30.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
MySQL Connectors Community 7.0 MB/s | 27 kB 00:00
Importing GPG key 0x5072E1F5:
Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
Fingerprint: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-protobuf-3.6.1-3.fc30.noarch 1/6
Installing : python2-protobuf-3.6.1-3.fc30.noarch 2/6
Installing : mysql-connector-python-8.0.17-1.fc30.x86_64 3/6
Installing : mysql-connector-python3-8.0.17-1.fc30.x86_64 4/6
Installing : mysql-connector-python3-cext-8.0.17-1.fc30.x86_64 5/6
Installing : mysql-connector-python-cext-8.0.17-1.fc30.x86_64 6/6
Running scriptlet: mysql-connector-python-cext-8.0.17-1.fc30.x86_64 6/6
Verifying : python2-protobuf-3.6.1-3.fc30.noarch 1/6
Verifying : python3-protobuf-3.6.1-3.fc30.noarch 2/6
Verifying : mysql-connector-python-8.0.17-1.fc30.x86_64 3/6
Verifying : mysql-connector-python-cext-8.0.17-1.fc30.x86_64 4/6
Verifying : mysql-connector-python3-8.0.17-1.fc30.x86_64 5/6
Verifying : mysql-connector-python3-cext-8.0.17-1.fc30.x86_64 6/6
Installed:
mysql-connector-python-8.0.17-1.fc30.x86_64 mysql-connector-python-cext-8.0.17-1.fc30.x86_64
mysql-connector-python3-8.0.17-1.fc30.x86_64 mysql-connector-python3-cext-8.0.17-1.fc30.x86_64
python2-protobuf-3.6.1-3.fc30.noarch python3-protobuf-3.6.1-3.fc30.noarch
Complete! |
Last metadata expiration check: 0:35:46 ago on Tue 20 Aug 2019 05:36:29 PM MDT.
Dependencies resolved.
=====================================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================================
Installing:
mysql-connector-python x86_64 8.0.17-1.fc30 mysql-connectors-community 435 k
mysql-connector-python-cext x86_64 8.0.17-1.fc30 mysql-connectors-community 7.7 M
mysql-connector-python3 x86_64 8.0.17-1.fc30 mysql-connectors-community 429 k
mysql-connector-python3-cext x86_64 8.0.17-1.fc30 mysql-connectors-community 7.7 M
Installing dependencies:
python2-protobuf noarch 3.6.1-3.fc30 fedora 563 k
python3-protobuf noarch 3.6.1-3.fc30 fedora 568 k
Transaction Summary
=====================================================================================================================================
Install 6 Packages
Total download size: 17 M
Installed size: 89 M
Downloading Packages:
(1/6): python3-protobuf-3.6.1-3.fc30.noarch.rpm 1.0 MB/s | 568 kB 00:00
(2/6): python2-protobuf-3.6.1-3.fc30.noarch.rpm 994 kB/s | 563 kB 00:00
(3/6): mysql-connector-python-8.0.17-1.fc30.x86_64.rpm 481 kB/s | 435 kB 00:00
(4/6): mysql-connector-python3-8.0.17-1.fc30.x86_64.rpm 612 kB/s | 429 kB 00:00
(5/6): mysql-connector-python-cext-8.0.17-1.fc30.x86_64.rpm 3.8 MB/s | 7.7 MB 00:02
(6/6): mysql-connector-python3-cext-8.0.17-1.fc30.x86_64.rpm 4.2 MB/s | 7.7 MB 00:01
-------------------------------------------------------------------------------------------------------------------------------------
Total 5.4 MB/s | 17 MB 00:03
warning: /var/cache/dnf/mysql-connectors-community-8bcc2bd350b53f70/packages/mysql-connector-python-8.0.17-1.fc30.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
MySQL Connectors Community 7.0 MB/s | 27 kB 00:00
Importing GPG key 0x5072E1F5:
Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
Fingerprint: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-protobuf-3.6.1-3.fc30.noarch 1/6
Installing : python2-protobuf-3.6.1-3.fc30.noarch 2/6
Installing : mysql-connector-python-8.0.17-1.fc30.x86_64 3/6
Installing : mysql-connector-python3-8.0.17-1.fc30.x86_64 4/6
Installing : mysql-connector-python3-cext-8.0.17-1.fc30.x86_64 5/6
Installing : mysql-connector-python-cext-8.0.17-1.fc30.x86_64 6/6
Running scriptlet: mysql-connector-python-cext-8.0.17-1.fc30.x86_64 6/6
Verifying : python2-protobuf-3.6.1-3.fc30.noarch 1/6
Verifying : python3-protobuf-3.6.1-3.fc30.noarch 2/6
Verifying : mysql-connector-python-8.0.17-1.fc30.x86_64 3/6
Verifying : mysql-connector-python-cext-8.0.17-1.fc30.x86_64 4/6
Verifying : mysql-connector-python3-8.0.17-1.fc30.x86_64 5/6
Verifying : mysql-connector-python3-cext-8.0.17-1.fc30.x86_64 6/6
Installed:
mysql-connector-python-8.0.17-1.fc30.x86_64 mysql-connector-python-cext-8.0.17-1.fc30.x86_64
mysql-connector-python3-8.0.17-1.fc30.x86_64 mysql-connector-python3-cext-8.0.17-1.fc30.x86_64
python2-protobuf-3.6.1-3.fc30.noarch python3-protobuf-3.6.1-3.fc30.noarch
Complete!
Leveraging the MySQL Connector/Python Coding Examples documentation, Section 5.1 Connecting to MySQL Using Connector/Python here’s a test of the connection to MySQL 8.
# Import the library.
import mysql.connector
from mysql.connector import errorcode
try:
# Open connection.
cnx = mysql.connector.connect(user='student', password='student',
host='127.0.0.1',
database='studentdb')
# Print the value.
print("Database connection resolved.")
# Handle exception and close connection.
except mysql.connector.Error as e:
if e.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif e.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(e)
# Close the connection when the try block completes.
else:
cnx.close() |
# Import the library.
import mysql.connector
from mysql.connector import errorcode
try:
# Open connection.
cnx = mysql.connector.connect(user='student', password='student',
host='127.0.0.1',
database='studentdb')
# Print the value.
print("Database connection resolved.")
# Handle exception and close connection.
except mysql.connector.Error as e:
if e.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif e.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(e)
# Close the connection when the try block completes.
else:
cnx.close()
Leveraging the MySQL Connector/Python Coding Examples documentation, Section 5.4 Querying Data Using Connector/Python here’s a test of the connection to MySQL 8.
# Import the library.
import datetime
import mysql.connector
from mysql.connector import errorcode
try:
# Open connection.
cnx = mysql.connector.connect(user='student', password='student',
host='127.0.0.1',
database='studentdb')
# Create cursor.
cursor = cnx.cursor()
# Set the query statement.
query = ("SELECT "
"CASE "
" WHEN item_subtitle IS NULL THEN item_title "
" ELSE CONCAT(item_title,': ',item_subtitle) "
"END AS title, "
"release_date "
"FROM item "
"WHERE release_date BETWEEN %s AND %s "
"ORDER BY item_title")
# Set the start and end date.
start_date = datetime.date(1991, 1, 1)
end_date = datetime.date(2004, 12, 31)
# Execute cursor.
cursor.execute(query, (start_date, end_date))
# Display the rows returned by the query.
for (item_name, release_date) in cursor:
print("{}, {:%d %b %Y}".format(item_name, release_date))
# Close cursor.
cursor.close()
# ------------------------------------------------------------
# Handle exception and close connection.
except mysql.connector.Error as e:
if e.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif e.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print "Error code:", e.errno # error number
print "SQLSTATE value:", e.sqlstate # SQLSTATE value
print "Error message:", e.msg # error message
# Close the connection when the try block completes.
else:
cnx.close() |
# Import the library.
import datetime
import mysql.connector
from mysql.connector import errorcode
try:
# Open connection.
cnx = mysql.connector.connect(user='student', password='student',
host='127.0.0.1',
database='studentdb')
# Create cursor.
cursor = cnx.cursor()
# Set the query statement.
query = ("SELECT "
"CASE "
" WHEN item_subtitle IS NULL THEN item_title "
" ELSE CONCAT(item_title,': ',item_subtitle) "
"END AS title, "
"release_date "
"FROM item "
"WHERE release_date BETWEEN %s AND %s "
"ORDER BY item_title")
# Set the start and end date.
start_date = datetime.date(1991, 1, 1)
end_date = datetime.date(2004, 12, 31)
# Execute cursor.
cursor.execute(query, (start_date, end_date))
# Display the rows returned by the query.
for (item_name, release_date) in cursor:
print("{}, {:%d %b %Y}".format(item_name, release_date))
# Close cursor.
cursor.close()
# ------------------------------------------------------------
# Handle exception and close connection.
except mysql.connector.Error as e:
if e.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif e.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print "Error code:", e.errno # error number
print "SQLSTATE value:", e.sqlstate # SQLSTATE value
print "Error message:", e.msg # error message
# Close the connection when the try block completes.
else:
cnx.close()
If you run the above in Python 2.7 it works fine. It fails to parse successfully in Python 3.x because the print()
function requires the parentheses all the time. You would need to re-write the except
block, like this with the parentheses:
# Handle exception and close connection.
except mysql.connector.Error as e:
if e.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif e.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print("Error code:", e.errno) # error number
print("SQLSTATE value:", e.sqlstate) # SQLSTATE value
print("Error message:", e.msg) # error message |
# Handle exception and close connection.
except mysql.connector.Error as e:
if e.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif e.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print("Error code:", e.errno) # error number
print("SQLSTATE value:", e.sqlstate) # SQLSTATE value
print("Error message:", e.msg) # error message
While it works without the parentheses in Python 2.7, it also works with the parentheses. That means the best practice is to write cross compatible code by always using the parentheses with the print()
function.
As always, I hope this helps somebody.j
My students wanted a quick example of how to read a list of a dictionaries in Python. So, here it is:
#!/usr/bin/python
# Declare list of dictionaries.
cakes = [{'cake':"vanilla",'frosting':"chocolate"}
,{'cake':"chocolate",'frosting':"vanilla"}]
# Read the list of dictionaries.
for lkey, lvalue in enumerate(cakes):
print lvalue['cake'] + " with " + lvalue['frosting'] + " frosting." |
#!/usr/bin/python
# Declare list of dictionaries.
cakes = [{'cake':"vanilla",'frosting':"chocolate"}
,{'cake':"chocolate",'frosting':"vanilla"}]
# Read the list of dictionaries.
for lkey, lvalue in enumerate(cakes):
print lvalue['cake'] + " with " + lvalue['frosting'] + " frosting."
Naturally, a list can contain many things and you should ensure each value you read is a dictionary before trying to read it as a dictionary. At least, I’d suggest you check.
Hope this answers the how.
If you’re on a Mac running macOS Sierra, you can install PIP to add packages. PIP stands for either of the following:
- PIP installs Packages
- PIP installs Python
You use the following to install the PIP utility:
It should return the following:
Searching for pip
Reading https://pypi.python.org/simple/pip/
Best match: pip 9.0.1
Downloading https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
Processing pip-9.0.1.tar.gz
Writing /tmp/easy_install-ryxjDg/pip-9.0.1/setup.cfg
Running pip-9.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ryxjDg/pip-9.0.1/egg-dist-tmp-l6_Jjt
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching '.landscape.yml'
warning: no previously-included files found matching 'pip/_vendor/Makefile'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'appveyor.yml'
no previously-included directories found matching '.github'
no previously-included directories found matching '.travis'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'contrib'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
creating /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg
Extracting pip-9.0.1-py2.7.egg to /Library/Python/2.7/site-packages
Adding pip 9.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin
Installed /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip |
Searching for pip
Reading https://pypi.python.org/simple/pip/
Best match: pip 9.0.1
Downloading https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
Processing pip-9.0.1.tar.gz
Writing /tmp/easy_install-ryxjDg/pip-9.0.1/setup.cfg
Running pip-9.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ryxjDg/pip-9.0.1/egg-dist-tmp-l6_Jjt
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching '.landscape.yml'
warning: no previously-included files found matching 'pip/_vendor/Makefile'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'appveyor.yml'
no previously-included directories found matching '.github'
no previously-included directories found matching '.travis'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'contrib'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
creating /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg
Extracting pip-9.0.1-py2.7.egg to /Library/Python/2.7/site-packages
Adding pip 9.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin
Installed /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
After you install PIP, you can use PIP to add custom packages to the Python environment. The
You get the following warning and installation:
The directory '/Users/michaelmclaughlin/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/michaelmclaughlin/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting easygui
Downloading easygui-0.98.1-py2.py3-none-any.whl (90kB)
100% |████████████████████████████████| 92kB 1.0MB/s
Installing collected packages: easygui
Successfully installed easygui-0.98.1 |
The directory '/Users/michaelmclaughlin/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/michaelmclaughlin/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting easygui
Downloading easygui-0.98.1-py2.py3-none-any.whl (90kB)
100% |████████████████████████████████| 92kB 1.0MB/s
Installing collected packages: easygui
Successfully installed easygui-0.98.1
After installing the easygui
Python library, you can change to the root
directory to confirm the installation of the easygui
Python library with the following command:
find . -name easygui* 2>/dev/null |
find . -name easygui* 2>/dev/null
It returns the following:
./Library/Python/2.7/site-packages/easygui
./Library/Python/2.7/site-packages/easygui/easygui.py
./Library/Python/2.7/site-packages/easygui/easygui.pyc
./Library/Python/2.7/site-packages/easygui-0.98.1.dist-info |
./Library/Python/2.7/site-packages/easygui
./Library/Python/2.7/site-packages/easygui/easygui.py
./Library/Python/2.7/site-packages/easygui/easygui.pyc
./Library/Python/2.7/site-packages/easygui-0.98.1.dist-info
You can connect to Python 2.7 in a Terminal session. Then, you use the easygui
library to run a Hello World! message box with the following commands in the Python shell:
import easygui
easy gui.msgbox("Hello World!") |
import easygui
easy gui.msgbox("Hello World!")
It will raise the following image:
Hopefully, this helps a few folks.
While working with a programming example for my students, I ran into an interesting run-time error when I changed their approach to importing Python’s random
module. Here’s the raised error message:
Traceback (most recent call last):
File "windowBouncingBalls.py", line 84, in <module>
speed = [choice([-2,2]), choice([-2,2])]
NameError: name 'choice' is not defined |
Traceback (most recent call last):
File "windowBouncingBalls.py", line 84, in <module>
speed = [choice([-2,2]), choice([-2,2])]
NameError: name 'choice' is not defined
You raise the missing choice
identifier when two things occur. The first thing requires you to use a standard import
statement, like the following example, and the second thing requires you to continue to reference the identifier as “choice
“.
You can avoid the error by making the import of random like this:
Or, you can leave the ordinary import statement and fully qualify the choice
identifier with the random
module name, like this:
speed = [random.choice([-2,2]), random.choice([-2,2])] |
speed = [random.choice([-2,2]), random.choice([-2,2])]
As always, I hope this helps those who encounter a similar problem.
The PyGame library is a wonderful tool for building games with Python. It lets you accomplish a great deal by simply managing events. You need to understand how to use Python functions, modules, and events to build games with this Python library.
You can download and install the PyGame library with the yum utility like this:
It should generate the following list when you install it as the root
user:
Loaded plugins: langpacks, refresh-packagekit
Available Packages
pygame.x86_64 1.9.1-14.fc20 fedora
[root@localhost ~]# yum install -y pygame
Loaded plugins: langpacks, refresh-packagekit
Resolving Dependencies
--> Running transaction check
---> Package pygame.x86_64 0:1.9.1-14.fc20 will be installed
--> Processing Dependency: numpy for package: pygame-1.9.1-14.fc20.x86_64
--> Processing Dependency: libportmidi.so.0()(64bit) for package: pygame-1.9.1-14.fc20.x86_64
--> Processing Dependency: libSDL_ttf-2.0.so.0()(64bit) for package: pygame-1.9.1-14.fc20.x86_64
--> Processing Dependency: libSDL_mixer-1.2.so.0()(64bit) for package: pygame-1.9.1-14.fc20.x86_64
--> Processing Dependency: libSDL_image-1.2.so.0()(64bit) for package: pygame-1.9.1-14.fc20.x86_64
--> Running transaction check
---> Package SDL_image.x86_64 0:1.2.12-7.fc20 will be installed
---> Package SDL_mixer.x86_64 0:1.2.12-5.fc20 will be installed
--> Processing Dependency: libmikmod for package: SDL_mixer-1.2.12-5.fc20.x86_64
---> Package SDL_ttf.x86_64 0:2.0.11-4.fc20 will be installed
---> Package numpy.x86_64 1:1.8.2-2.fc20 will be installed
--> Processing Dependency: python-nose for package: 1:numpy-1.8.2-2.fc20.x86_64
---> Package portmidi.x86_64 0:217-9.fc20 will be installed
--> Running transaction check
---> Package libmikmod.x86_64 0:3.3.6-3.fc20 will be installed
---> Package python-nose.noarch 0:1.3.0-1.fc20 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
pygame x86_64 1.9.1-14.fc20 fedora 2.1 M
Installing for dependencies:
SDL_image x86_64 1.2.12-7.fc20 fedora 41 k
SDL_mixer x86_64 1.2.12-5.fc20 fedora 91 k
SDL_ttf x86_64 2.0.11-4.fc20 fedora 22 k
libmikmod x86_64 3.3.6-3.fc20 updates 142 k
numpy x86_64 1:1.8.2-2.fc20 updates 3.0 M
portmidi x86_64 217-9.fc20 fedora 26 k
python-nose noarch 1.3.0-1.fc20 fedora 272 k
Transaction Summary
================================================================================
Install 1 Package (+7 Dependent packages)
Total download size: 5.7 M
Installed size: 21 M
Downloading packages:
(1/8): SDL_image-1.2.12-7.fc20.x86_64.rpm | 41 kB 00:00
(2/8): SDL_mixer-1.2.12-5.fc20.x86_64.rpm | 91 kB 00:00
(3/8): portmidi-217-9.fc20.x86_64.rpm | 26 kB 00:00
(4/8): SDL_ttf-2.0.11-4.fc20.x86_64.rpm | 22 kB 00:00
(5/8): libmikmod-3.3.6-3.fc20.x86_64.rpm | 142 kB 00:00
(6/8): numpy-1.8.2-2.fc20.x86_64.rpm | 3.0 MB 00:02
(7/8): pygame-1.9.1-14.fc20.x86_64.rpm | 2.1 MB 00:01
(8/8): python-nose-1.3.0-1.fc20.noarch.rpm | 272 kB 00:00
--------------------------------------------------------------------------------
Total 1.7 MB/s | 5.7 MB 00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction (shutdown inhibited)
Installing : SDL_ttf-2.0.11-4.fc20.x86_64 1/8
Installing : SDL_image-1.2.12-7.fc20.x86_64 2/8
Installing : portmidi-217-9.fc20.x86_64 3/8
Installing : libmikmod-3.3.6-3.fc20.x86_64 4/8
Installing : SDL_mixer-1.2.12-5.fc20.x86_64 5/8
Installing : python-nose-1.3.0-1.fc20.noarch 6/8
Installing : 1:numpy-1.8.2-2.fc20.x86_64 7/8
Installing : pygame-1.9.1-14.fc20.x86_64 8/8
Verifying : pygame-1.9.1-14.fc20.x86_64 1/8
Verifying : SDL_mixer-1.2.12-5.fc20.x86_64 2/8
Verifying : python-nose-1.3.0-1.fc20.noarch 3/8
Verifying : libmikmod-3.3.6-3.fc20.x86_64 4/8
Verifying : 1:numpy-1.8.2-2.fc20.x86_64 5/8
Verifying : portmidi-217-9.fc20.x86_64 6/8
Verifying : SDL_image-1.2.12-7.fc20.x86_64 7/8
Verifying : SDL_ttf-2.0.11-4.fc20.x86_64 8/8
Installed:
pygame.x86_64 0:1.9.1-14.fc20
Dependency Installed:
SDL_image.x86_64 0:1.2.12-7.fc20 SDL_mixer.x86_64 0:1.2.12-5.fc20
SDL_ttf.x86_64 0:2.0.11-4.fc20 libmikmod.x86_64 0:3.3.6-3.fc20
numpy.x86_64 1:1.8.2-2.fc20 portmidi.x86_64 0:217-9.fc20
python-nose.noarch 0:1.3.0-1.fc20
Complete! |
Loaded plugins: langpacks, refresh-packagekit
Available Packages
pygame.x86_64 1.9.1-14.fc20 fedora
[root@localhost ~]# yum install -y pygame
Loaded plugins: langpacks, refresh-packagekit
Resolving Dependencies
--> Running transaction check
---> Package pygame.x86_64 0:1.9.1-14.fc20 will be installed
--> Processing Dependency: numpy for package: pygame-1.9.1-14.fc20.x86_64
--> Processing Dependency: libportmidi.so.0()(64bit) for package: pygame-1.9.1-14.fc20.x86_64
--> Processing Dependency: libSDL_ttf-2.0.so.0()(64bit) for package: pygame-1.9.1-14.fc20.x86_64
--> Processing Dependency: libSDL_mixer-1.2.so.0()(64bit) for package: pygame-1.9.1-14.fc20.x86_64
--> Processing Dependency: libSDL_image-1.2.so.0()(64bit) for package: pygame-1.9.1-14.fc20.x86_64
--> Running transaction check
---> Package SDL_image.x86_64 0:1.2.12-7.fc20 will be installed
---> Package SDL_mixer.x86_64 0:1.2.12-5.fc20 will be installed
--> Processing Dependency: libmikmod for package: SDL_mixer-1.2.12-5.fc20.x86_64
---> Package SDL_ttf.x86_64 0:2.0.11-4.fc20 will be installed
---> Package numpy.x86_64 1:1.8.2-2.fc20 will be installed
--> Processing Dependency: python-nose for package: 1:numpy-1.8.2-2.fc20.x86_64
---> Package portmidi.x86_64 0:217-9.fc20 will be installed
--> Running transaction check
---> Package libmikmod.x86_64 0:3.3.6-3.fc20 will be installed
---> Package python-nose.noarch 0:1.3.0-1.fc20 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
pygame x86_64 1.9.1-14.fc20 fedora 2.1 M
Installing for dependencies:
SDL_image x86_64 1.2.12-7.fc20 fedora 41 k
SDL_mixer x86_64 1.2.12-5.fc20 fedora 91 k
SDL_ttf x86_64 2.0.11-4.fc20 fedora 22 k
libmikmod x86_64 3.3.6-3.fc20 updates 142 k
numpy x86_64 1:1.8.2-2.fc20 updates 3.0 M
portmidi x86_64 217-9.fc20 fedora 26 k
python-nose noarch 1.3.0-1.fc20 fedora 272 k
Transaction Summary
================================================================================
Install 1 Package (+7 Dependent packages)
Total download size: 5.7 M
Installed size: 21 M
Downloading packages:
(1/8): SDL_image-1.2.12-7.fc20.x86_64.rpm | 41 kB 00:00
(2/8): SDL_mixer-1.2.12-5.fc20.x86_64.rpm | 91 kB 00:00
(3/8): portmidi-217-9.fc20.x86_64.rpm | 26 kB 00:00
(4/8): SDL_ttf-2.0.11-4.fc20.x86_64.rpm | 22 kB 00:00
(5/8): libmikmod-3.3.6-3.fc20.x86_64.rpm | 142 kB 00:00
(6/8): numpy-1.8.2-2.fc20.x86_64.rpm | 3.0 MB 00:02
(7/8): pygame-1.9.1-14.fc20.x86_64.rpm | 2.1 MB 00:01
(8/8): python-nose-1.3.0-1.fc20.noarch.rpm | 272 kB 00:00
--------------------------------------------------------------------------------
Total 1.7 MB/s | 5.7 MB 00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction (shutdown inhibited)
Installing : SDL_ttf-2.0.11-4.fc20.x86_64 1/8
Installing : SDL_image-1.2.12-7.fc20.x86_64 2/8
Installing : portmidi-217-9.fc20.x86_64 3/8
Installing : libmikmod-3.3.6-3.fc20.x86_64 4/8
Installing : SDL_mixer-1.2.12-5.fc20.x86_64 5/8
Installing : python-nose-1.3.0-1.fc20.noarch 6/8
Installing : 1:numpy-1.8.2-2.fc20.x86_64 7/8
Installing : pygame-1.9.1-14.fc20.x86_64 8/8
Verifying : pygame-1.9.1-14.fc20.x86_64 1/8
Verifying : SDL_mixer-1.2.12-5.fc20.x86_64 2/8
Verifying : python-nose-1.3.0-1.fc20.noarch 3/8
Verifying : libmikmod-3.3.6-3.fc20.x86_64 4/8
Verifying : 1:numpy-1.8.2-2.fc20.x86_64 5/8
Verifying : portmidi-217-9.fc20.x86_64 6/8
Verifying : SDL_image-1.2.12-7.fc20.x86_64 7/8
Verifying : SDL_ttf-2.0.11-4.fc20.x86_64 8/8
Installed:
pygame.x86_64 0:1.9.1-14.fc20
Dependency Installed:
SDL_image.x86_64 0:1.2.12-7.fc20 SDL_mixer.x86_64 0:1.2.12-5.fc20
SDL_ttf.x86_64 0:2.0.11-4.fc20 libmikmod.x86_64 0:3.3.6-3.fc20
numpy.x86_64 1:1.8.2-2.fc20 portmidi.x86_64 0:217-9.fc20
python-nose.noarch 0:1.3.0-1.fc20
Complete!
I hope this helps folks install the software.