Replies: 2 comments 1 reply
-
|
Please see the installation notes here: https://pypi.org/project/DBcm/ -
specifically the bit on PythonAnywhere. You may need to add "--user" to the
command-line on PythonAnywhere, too. Release 2 of DBcm is
PythonAnywhere-compatible and targets MySQL.
Locally, if you are using MariaDB (as I am, on a Mac, too), make sure the
latest DBcm in installed with this command:
pip install --upgrade DBcm
This should put the MariaDB-specific DBcm on your computer, Release 3.
Let me know how you get on (and reach out again, as needed). Thanks.
Paul.
…On Thu, 6 Feb 2025 at 17:13, Matt Raible ***@***.***> wrote:
When I run python3 -m pip install DBcm on PythonAnywhere, I get an error:
Defaulting to user installation because normal site-packages is not writeable
Looking in links: /usr/share/pip-wheels
Collecting DBcm
Using cached dbcm-3.0.5-py3-none-any.whl (4.4 kB)
Collecting mariadb
Using cached mariadb-1.1.11.tar.gz (85 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [30 lines of output]
/bin/sh: 1: mariadb_config: not found
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_proce
ss/_in_process.py", line 363, in <module>
main()
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_proce
ss/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_proce
ss/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-bojhhixr/overlay/lib/python3.10/site-packages/se
tuptools/build_meta.py", line 334, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
'mariadb_config' option to the file location of the mariadb_config utility
File "/tmp/pip-build-env-bojhhixr/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-bojhhixr/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 522, in run_setup
super().run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-bojhhixr/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in run_setup
exec(code, locals())
File "<string>", line 27, in <module>
File "/tmp/pip-install-r5y0y6em/mariadb_0f61912ca15441a98d238dacf46cabe2/mariadb_posix.py", line 62, in get_config
cc_version = mariadb_config(config_prg, "cc_version")
File "/tmp/pip-install-r5y0y6em/mariadb_0f61912ca15441a98d238dacf46cabe2/mariadb_posix.py", line 28, in mariadb_config
raise EnvironmentError(
OSError: mariadb_config not found.
This error typically indicates that MariaDB Connector/C, a dependency which
must be preinstalled, is not found.
If MariaDB Connector/C is not installed, see installation instructions
If MariaDB Connector/C is installed, either set the environment variable
MARIADB_CONFIG or edit the configuration file 'site.cfg' to set the
'mariadb_config' option to the file location of the mariadb_config utility.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with p
ip.
Related: when I try to run things locally (on macOS) with MariaDB, I also
get an error when running python app.py and trying to access /swims:
* Serving Flask app 'app'
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: 560-256-253
127.0.0.1 - - [06/Feb/2025 10:11:31] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [06/Feb/2025 10:11:31] "GET /static/webapp.css HTTP/1.1" 304 -
127.0.0.1 - - [06/Feb/2025 10:11:32] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [06/Feb/2025 10:11:32] "GET /static/webapp.css HTTP/1.1" 304 -
127.0.0.1 - - [06/Feb/2025 10:11:34] "GET /swims HTTP/1.1" 500 -
Traceback (most recent call last):
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/mysql/connector/connection_cext.py", line 755, in cmd_query
self._cmysql.query(
^
_mysql_connector.MySQLInterfaceError: Unknown collation: 'utf8mb4_0900_ai_ci'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/flask/app.py", line 1536, in __call__
return self.wsgi_app(environ, start_response)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/flask/app.py", line 1514, in wsgi_app
response = self.handle_exception(e)
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/flask/app.py", line 1511, in wsgi_app
response = self.full_dispatch_request()
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/flask/app.py", line 919, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/Users/mraible/dev/Learning/webapp/app.py", line 27, in display_swim_sessions
data = data_utils.get_swim_sessions()
File "/Users/mraible/dev/Learning/webapp/data_utils.py", line 27, in get_swim_sessions
with DBcm.UseDatabase(db_details) as db:
~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/DBcm.py", line 96, in __enter__
self.conn = mysql.connector.connect(**self.configuration)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/mysql/connector/pooling.py", line 322, in connect
return CMySQLConnection(*args, **kwargs)
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/mysql/connector/connection_cext.py", line 153, in __init__
self.connect(**kwargs)
~~~~~~~~~~~~^^^^^^^^^^
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/mysql/connector/abstracts.py", line 1541, in connect
self._post_connection()
~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/mysql/connector/abstracts.py", line 1481, in _post_connection
self.set_charset_collation(charset=self._charset_id)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/mysql/connector/abstracts.py", line 1366, in set_charset_collation
self._execute_query(f"SET NAMES '{charset_name}' COLLATE '{collation_name}'")
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/mysql/connector/opentelemetry/context_propagation.py", line 97, in wrapper
return method(cnx, *args, **kwargs)
File "/Users/mraible/dev/Learning/webapp/.venv/lib/python3.13/site-packages/mysql/connector/connection_cext.py", line 763, in cmd_query
raise get_mysql_exception(
^^^^^^^^^^
mysql.connector.errors.DatabaseError: 1273 (HY000): Unknown collation: 'utf8mb4_0900_ai_ci'
—
Reply to this email directly, view it on GitHub
<#11>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7O3GTGKRZBDBN3DUBWSTXT2OOJ2FAVCNFSM6AAAAABWUB2NUOVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXHEZDINRXG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Paul Barry
MSc, BSc, PG Cert (T&L)
Lecturer - Department of Computing
E ***@***.*** | *setu.ie* <https://setu.ie> | work
E ***@***.*** | personal
[image: turn on images] <https://setu.ie>
Kilkenny Road Campus, Kilkenny Road, Carlow, R93 V960, Ireland
Campas Bhóthar Chill Chainnigh, Bóthar Chill Chainnigh, Ceatharlach, R93
V960, Éire
|
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Great news! 👍
Paul.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When I run
python3 -m pip install DBcmon PythonAnywhere, I get an error:Related: when I try to run things locally (on macOS) with MariaDB, I also get an error when running
python app.pyand trying to access/swims:Beta Was this translation helpful? Give feedback.
All reactions