Mailing List Archive

Trac / MySQL-python on Ubuntu 20.04
Hello together,

I have just noticed that the necessary MySQL-python
<https://pypi.org/project/MySQL-python/> is not running under Ubuntu 20.04
anymore, more specificly, it cannot be installed with "pip install
MySQL-python".

I would need this to run Trac 2.2.5 with MariaDB. Under Ubuntu 18.04, I did
exactly the same steps and installation was no problem.

Is there any way to get Trac running under Ubuntu 20.04 with MariaDB as a
database?
Unfortunately, downgrading our server to Ubuntu 18.04 isn't really an
option...

Any help appreciated!
Thank you!

Error under Ubuntu 20.04:

root@server:/# pip install MySQL-python
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0
will drop support for Python 2.7 in January 2021. More details about Python
2 support in pip, can be found at
https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip (108 kB)
Building wheels for collected packages: MySQL-python
Building wheel for MySQL-python (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize;
sys.argv[0] = '"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';
__file__='"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
bdist_wheel -d /tmp/pip-wheel-mQzdal
cwd: /tmp/pip-install-pcwRtX/MySQL-python/
Complete output (30 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
-D_FORTIFY_SOURCE=2 -g
-fdebug-prefix-map=/build/python2.7-U5f0ID/python2.7-2.7.18=.
-fstack-protector-strong -Wformat -Werror=format-security -fPIC
-Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
-I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
_mysql.c:29:10: fatal error: Python.h: No such file or directory
29 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for MySQL-python
Running setup.py clean for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize;
sys.argv[0] = '"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';
__file__='"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
install --record /tmp/pip-record-MyCi8N/install-record.txt
--single-version-externally-managed --compile --install-headers
/usr/local/include/python2.7/MySQL-python
cwd: /tmp/pip-install-pcwRtX/MySQL-python/
Complete output (30 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
-D_FORTIFY_SOURCE=2 -g
-fdebug-prefix-map=/build/python2.7-U5f0ID/python2.7-2.7.18=.
-fstack-protector-strong -Wformat -Werror=format-security -fPIC
-Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
-I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
_mysql.c:29:10: fatal error: Python.h: No such file or directory
29 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python2 -u -c
'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';
__file__='"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
install --record /tmp/pip-record-MyCi8N/install-record.txt
--single-version-externally-managed --compile --install-headers
/usr/local/include/python2.7/MySQL-python Check the logs for full command
output.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/8cf8b089-25ad-41f2-abb0-705b2a25a6c5n%40googlegroups.com.
Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
On Fri, Nov 13, 2020 at 12:38 AM Andreas <muffelmuff@gmail.com> wrote:
> I have just noticed that the necessary MySQL-python is not running under Ubuntu 20.04 anymore, more specificly, it cannot be installed with "pip install MySQL-python".
>
> I would need this to run Trac 2.2.5 with MariaDB. Under Ubuntu 18.04, I did exactly the same steps and installation was no problem.
>
> Is there any way to get Trac running under Ubuntu 20.04 with MariaDB as a database?
> Unfortunately, downgrading our server to Ubuntu 18.04 isn't really an option...
>
> Any help appreciated!
> Thank you!
>
> Error under Ubuntu 20.04:
>
> root@server:/# pip install MySQL-python
> ...
> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-U5f0ID/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
> _mysql.c:29:10: fatal error: Python.h: No such file or directory
> 29 | #include "Python.h"
> | ^~~~~~~~~~
> compilation terminated.
> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
> ...

python2.7-dev and libmariadb-dev-compat packages are required to build
MySQL-python library.

$ sudo apt install python2.7-dev libmariadb-dev-compat

--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMaiSXCPUHZK_A9L3ba%2Bfy1cuX_3aXWS-f68qJDaR-0mudg%40mail.gmail.com.
Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
Hi ,

You need to install ptyhon-dev so you get python.h

Cheers

Markus

Andreas <muffelmuff@gmail.com> schrieb am Do., 12. Nov. 2020, 16:38:

> Hello together,
>
> I have just noticed that the necessary MySQL-python
> <https://pypi.org/project/MySQL-python/> is not running under Ubuntu
> 20.04 anymore, more specificly, it cannot be installed with "pip install
> MySQL-python".
>
> I would need this to run Trac 2.2.5 with MariaDB. Under Ubuntu 18.04, I
> did exactly the same steps and installation was no problem.
>
> Is there any way to get Trac running under Ubuntu 20.04 with MariaDB as a
> database?
> Unfortunately, downgrading our server to Ubuntu 18.04 isn't really an
> option...
>
> Any help appreciated!
> Thank you!
>
> Error under Ubuntu 20.04:
>
> root@server:/# pip install MySQL-python
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
> Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0
> will drop support for Python 2.7 in January 2021. More details about Python
> 2 support in pip, can be found at
> https://pip.pypa.io/en/latest/development/release-process/#python-2-support
> Collecting MySQL-python
> Using cached MySQL-python-1.2.5.zip (108 kB)
> Building wheels for collected packages: MySQL-python
> Building wheel for MySQL-python (setup.py) ... error
> ERROR: Command errored out with exit status 1:
> command: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize;
> sys.argv[0] = '"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> bdist_wheel -d /tmp/pip-wheel-mQzdal
> cwd: /tmp/pip-install-pcwRtX/MySQL-python/
> Complete output (30 lines):
> running bdist_wheel
> running build
> running build_py
> creating build
> creating build/lib.linux-x86_64-2.7
> copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
> creating build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
> creating build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/__init__.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/CR.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/FIELD_TYPE.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/ER.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/FLAG.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/REFRESH.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/CLIENT.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> running build_ext
> building '_mysql' extension
> creating build/temp.linux-x86_64-2.7
> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
> -D_FORTIFY_SOURCE=2 -g
> -fdebug-prefix-map=/build/python2.7-U5f0ID/python2.7-2.7.18=.
> -fstack-protector-strong -Wformat -Werror=format-security -fPIC
> -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
> -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
> _mysql.c:29:10: fatal error: Python.h: No such file or directory
> 29 | #include "Python.h"
> | ^~~~~~~~~~
> compilation terminated.
> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
> ----------------------------------------
> ERROR: Failed building wheel for MySQL-python
> Running setup.py clean for MySQL-python
> Failed to build MySQL-python
> Installing collected packages: MySQL-python
> Running setup.py install for MySQL-python ... error
> ERROR: Command errored out with exit status 1:
> command: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize;
> sys.argv[0] = '"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> install --record /tmp/pip-record-MyCi8N/install-record.txt
> --single-version-externally-managed --compile --install-headers
> /usr/local/include/python2.7/MySQL-python
> cwd: /tmp/pip-install-pcwRtX/MySQL-python/
> Complete output (30 lines):
> running install
> running build
> running build_py
> creating build
> creating build/lib.linux-x86_64-2.7
> copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
> creating build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
> creating build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/__init__.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/CR.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/FIELD_TYPE.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/ER.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/FLAG.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/REFRESH.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/CLIENT.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> running build_ext
> building '_mysql' extension
> creating build/temp.linux-x86_64-2.7
> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
> -D_FORTIFY_SOURCE=2 -g
> -fdebug-prefix-map=/build/python2.7-U5f0ID/python2.7-2.7.18=.
> -fstack-protector-strong -Wformat -Werror=format-security -fPIC
> -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
> -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
> _mysql.c:29:10: fatal error: Python.h: No such file or directory
> 29 | #include "Python.h"
> | ^~~~~~~~~~
> compilation terminated.
> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
> ----------------------------------------
> ERROR: Command errored out with exit status 1: /usr/bin/python2 -u -c
> 'import sys, setuptools, tokenize; sys.argv[0] =
> '"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> install --record /tmp/pip-record-MyCi8N/install-record.txt
> --single-version-externally-managed --compile --install-headers
> /usr/local/include/python2.7/MySQL-python Check the logs for full command
> output.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to trac-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/trac-users/8cf8b089-25ad-41f2-abb0-705b2a25a6c5n%40googlegroups.com
> <https://groups.google.com/d/msgid/trac-users/8cf8b089-25ad-41f2-abb0-705b2a25a6c5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAJ4osO%3Dt6xZ6FyZ6L5CtjdbzsE5cTtVhRu1JxKs%2B5HHcEyTFBA%40mail.gmail.com.
Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
Thank you both for your hints. I just intalled the two programs and now I
am still getting a (slightly different) error.... Any further ideas?


root@server:/# pip install MySQL-python
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0
will drop support for Python 2.7 in January 2021. More details about Python
2 support in pip can be found at
https://pip.pypa.io/en/latest/development/release-process/#python-2-support
pip 21.0 will remove support for this functionality.
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip (108 kB)
Building wheels for collected packages: MySQL-python
Building wheel for MySQL-python (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize;
sys.argv[0] = '"'"'/tmp/pip-install-AR0wp8/mysql-python/setup.py'"'"';
__file__='"'"'/tmp/pip-install-AR0wp8/mysql-python/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
bdist_wheel -d /tmp/pip-wheel-NggNke
cwd: /tmp/pip-install-AR0wp8/mysql-python/
Complete output (34 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
-D_FORTIFY_SOURCE=2 -g
-fdebug-prefix-map=/build/python2.7-U5f0ID/python2.7-2.7.18=.
-fstack-protector-strong -Wformat -Werror=format-security -fPIC
-Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mariadb
-I/usr/include/mariadb/mysql -I/usr/include/python2.7 -c _mysql.c -o
build/temp.linux-x86_64-2.7/_mysql.o
In file included from _mysql.c:44:
/usr/include/mariadb/my_config.h:3:2: warning: #warning This file should
not be included by clients, include only <mysql.h> [-Wcpp]
3 | #warning This file should not be included by clients, include
only <mysql.h>
| ^~~~~~~
_mysql.c: In function ‘_mysql_ConnectionObject_ping’:
_mysql.c:2005:41: error: ‘MYSQL’ {aka ‘struct st_mysql’} has no member
named ‘reconnect’
2005 | if ( reconnect != -1 ) self->connection.reconnect = reconnect;
| ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for MySQL-python
Running setup.py clean for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize;
sys.argv[0] = '"'"'/tmp/pip-install-AR0wp8/mysql-python/setup.py'"'"';
__file__='"'"'/tmp/pip-install-AR0wp8/mysql-python/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
install --record /tmp/pip-record-vPnHkG/install-record.txt
--single-version-externally-managed --compile --install-headers
/usr/local/include/python2.7/MySQL-python
cwd: /tmp/pip-install-AR0wp8/mysql-python/
Complete output (34 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
-D_FORTIFY_SOURCE=2 -g
-fdebug-prefix-map=/build/python2.7-U5f0ID/python2.7-2.7.18=.
-fstack-protector-strong -Wformat -Werror=format-security -fPIC
-Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mariadb
-I/usr/include/mariadb/mysql -I/usr/include/python2.7 -c _mysql.c -o
build/temp.linux-x86_64-2.7/_mysql.o
In file included from _mysql.c:44:
/usr/include/mariadb/my_config.h:3:2: warning: #warning This file
should not be included by clients, include only <mysql.h> [-Wcpp]
3 | #warning This file should not be included by clients, include
only <mysql.h>
| ^~~~~~~
_mysql.c: In function ‘_mysql_ConnectionObject_ping’:
_mysql.c:2005:41: error: ‘MYSQL’ {aka ‘struct st_mysql’} has no member
named ‘reconnect’
2005 | if ( reconnect != -1 ) self->connection.reconnect = reconnect;
| ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python2 -u -c
'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-AR0wp8/mysql-python/setup.py'"'"';
__file__='"'"'/tmp/pip-install-AR0wp8/mysql-python/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
install --record /tmp/pip-record-vPnHkG/install-record.txt
--single-version-externally-managed --compile --install-headers
/usr/local/include/python2.7/MySQL-python Check the logs for full command
output.


markus...@gmail.com schrieb am Donnerstag, 12. November 2020 um 17:01:46
UTC+1:

> Hi ,
>
> You need to install ptyhon-dev so you get python.h
>
> Cheers
>
> Markus
>
> Andreas <muffe...@gmail.com> schrieb am Do., 12. Nov. 2020, 16:38:
>
>> Hello together,
>>
>> I have just noticed that the necessary MySQL-python
>> <https://pypi.org/project/MySQL-python/> is not running under Ubuntu
>> 20.04 anymore, more specificly, it cannot be installed with "pip install
>> MySQL-python".
>>
>> I would need this to run Trac 2.2.5 with MariaDB. Under Ubuntu 18.04, I
>> did exactly the same steps and installation was no problem.
>>
>> Is there any way to get Trac running under Ubuntu 20.04 with MariaDB as a
>> database?
>> Unfortunately, downgrading our server to Ubuntu 18.04 isn't really an
>> option...
>>
>> Any help appreciated!
>> Thank you!
>>
>> Error under Ubuntu 20.04:
>>
>> root@server:/# pip install MySQL-python
>> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
>> Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0
>> will drop support for Python 2.7 in January 2021. More details about Python
>> 2 support in pip, can be found at
>> https://pip.pypa.io/en/latest/development/release-process/#python-2-support
>> Collecting MySQL-python
>> Using cached MySQL-python-1.2.5.zip (108 kB)
>> Building wheels for collected packages: MySQL-python
>> Building wheel for MySQL-python (setup.py) ... error
>> ERROR: Command errored out with exit status 1:
>> command: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize;
>> sys.argv[0] = '"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';
>> __file__='"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';f=getattr(tokenize,
>> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
>> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
>> bdist_wheel -d /tmp/pip-wheel-mQzdal
>> cwd: /tmp/pip-install-pcwRtX/MySQL-python/
>> Complete output (30 lines):
>> running bdist_wheel
>> running build
>> running build_py
>> creating build
>> creating build/lib.linux-x86_64-2.7
>> copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
>> creating build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> creating build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/__init__.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/CR.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/FIELD_TYPE.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/ER.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/FLAG.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/REFRESH.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/CLIENT.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> running build_ext
>> building '_mysql' extension
>> creating build/temp.linux-x86_64-2.7
>> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
>> -D_FORTIFY_SOURCE=2 -g
>> -fdebug-prefix-map=/build/python2.7-U5f0ID/python2.7-2.7.18=.
>> -fstack-protector-strong -Wformat -Werror=format-security -fPIC
>> -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
>> -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
>> _mysql.c:29:10: fatal error: Python.h: No such file or directory
>> 29 | #include "Python.h"
>> | ^~~~~~~~~~
>> compilation terminated.
>> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
>> ----------------------------------------
>> ERROR: Failed building wheel for MySQL-python
>> Running setup.py clean for MySQL-python
>> Failed to build MySQL-python
>> Installing collected packages: MySQL-python
>> Running setup.py install for MySQL-python ... error
>> ERROR: Command errored out with exit status 1:
>> command: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize;
>> sys.argv[0] = '"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';
>> __file__='"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';f=getattr(tokenize,
>> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
>> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
>> install --record /tmp/pip-record-MyCi8N/install-record.txt
>> --single-version-externally-managed --compile --install-headers
>> /usr/local/include/python2.7/MySQL-python
>> cwd: /tmp/pip-install-pcwRtX/MySQL-python/
>> Complete output (30 lines):
>> running install
>> running build
>> running build_py
>> creating build
>> creating build/lib.linux-x86_64-2.7
>> copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
>> creating build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> creating build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/__init__.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/CR.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/FIELD_TYPE.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/ER.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/FLAG.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/REFRESH.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/CLIENT.py ->
>> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> running build_ext
>> building '_mysql' extension
>> creating build/temp.linux-x86_64-2.7
>> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
>> -D_FORTIFY_SOURCE=2 -g
>> -fdebug-prefix-map=/build/python2.7-U5f0ID/python2.7-2.7.18=.
>> -fstack-protector-strong -Wformat -Werror=format-security -fPIC
>> -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
>> -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
>> _mysql.c:29:10: fatal error: Python.h: No such file or directory
>> 29 | #include "Python.h"
>> | ^~~~~~~~~~
>> compilation terminated.
>> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
>> ----------------------------------------
>> ERROR: Command errored out with exit status 1: /usr/bin/python2 -u -c
>> 'import sys, setuptools, tokenize; sys.argv[0] =
>> '"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';
>> __file__='"'"'/tmp/pip-install-pcwRtX/MySQL-python/setup.py'"'"';f=getattr(tokenize,
>> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
>> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
>> install --record /tmp/pip-record-MyCi8N/install-record.txt
>> --single-version-externally-managed --compile --install-headers
>> /usr/local/include/python2.7/MySQL-python Check the logs for full command
>> output.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Trac Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to trac-users+...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/trac-users/8cf8b089-25ad-41f2-abb0-705b2a25a6c5n%40googlegroups.com
>> <https://groups.google.com/d/msgid/trac-users/8cf8b089-25ad-41f2-abb0-705b2a25a6c5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/12a416dc-863f-4e52-ac05-2027428fc7e8n%40googlegroups.com.
Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
On Thursday, November 12, 2020 at 7:38:49 AM UTC-8 Andreas wrote:

> Hello together,
>
> I have just noticed that the necessary MySQL-python
> <https://pypi.org/project/MySQL-python/> is not running under Ubuntu
> 20.04 anymore, more specificly, it cannot be installed with "pip install
> MySQL-python".
>
> I would need this to run Trac 2.2.5 with MariaDB. Under Ubuntu 18.04, I
> did exactly the same steps and installation was no problem.
>
> Is there any way to get Trac running under Ubuntu 20.04 with MariaDB as a
> database?
> Unfortunately, downgrading our server to Ubuntu 18.04 isn't really an
> option...
>
> Any help appreciated!
> Thank you!
>

Have you considered switching to Trac 1.4.2? The dependency is PyMySQL. We
made the switch because MySQLdb is no longer developed.

Ryan

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/3af2b6b8-bdbb-400b-b665-d5fd56a67bacn%40googlegroups.com.
Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
I just tested all our plugins with 1.4.2, but the TracHoursPlugin
<https://trac-hacks.org/query?status=!closed&component=TracHoursPlugin> is
not working on this version, so this is currently no option...I have
created a ticket <https://trac-hacks.org/ticket/13907>for this issue.

RjOllos schrieb am Donnerstag, 12. November 2020 um 17:56:10 UTC+1:

> On Thursday, November 12, 2020 at 7:38:49 AM UTC-8 Andreas wrote:
>
>> Hello together,
>>
>> I have just noticed that the necessary MySQL-python
>> <https://pypi.org/project/MySQL-python/> is not running under Ubuntu
>> 20.04 anymore, more specificly, it cannot be installed with "pip install
>> MySQL-python".
>>
>> I would need this to run Trac 2.2.5 with MariaDB. Under Ubuntu 18.04, I
>> did exactly the same steps and installation was no problem.
>>
>> Is there any way to get Trac running under Ubuntu 20.04 with MariaDB as a
>> database?
>> Unfortunately, downgrading our server to Ubuntu 18.04 isn't really an
>> option...
>>
>> Any help appreciated!
>> Thank you!
>>
>
> Have you considered switching to Trac 1.4.2? The dependency is PyMySQL. We
> made the switch because MySQLdb is no longer developed.
>
> Ryan
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/29792a18-498f-450b-9c8a-315d006fa695n%40googlegroups.com.
Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
Hello again,

I do now really have to migrate our database to MariaDB as we have to
access Trac from another system to read and write data to it.

As the pip-installation is not working anymore, I found a way to install
python-mysqldb (is this even the right package?!) on Ubuntu 20.04 by adding
an older repository to my installation with the following commands:

sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main'
sudo apt update
sudo apt install -y python-mysqldb

Source:
https://stackoverflow.com/questions/63457213/how-to-install-python-mysqldb-for-python-2-7-in-ubuntu-20-04-focal-fossa

... but I am still getting the error during Trac migration that says
"trac.core.TracError: Unsupported database type "mysql".
Any idea of what coul be wrong / how to install the right package on Ubuntu
20.04?

As long as the TracHoursPlugin is not working on Trac 1.4.2, I really need
to find a way to migrate the older 1.2.2 to MySQL on Ubuntu 20.04...

Thanks for any hints!!

Andreas schrieb am Donnerstag, 12. November 2020 um 19:13:30 UTC+1:

> I just tested all our plugins with 1.4.2, but the TracHoursPlugin
> <https://trac-hacks.org/query?status=!closed&component=TracHoursPlugin>
> is not working on this version, so this is currently no option...I have
> created a ticket <https://trac-hacks.org/ticket/13907>for this issue.
>
> RjOllos schrieb am Donnerstag, 12. November 2020 um 17:56:10 UTC+1:
>
>> On Thursday, November 12, 2020 at 7:38:49 AM UTC-8 Andreas wrote:
>>
>>> Hello together,
>>>
>>> I have just noticed that the necessary MySQL-python
>>> <https://pypi.org/project/MySQL-python/> is not running under Ubuntu
>>> 20.04 anymore, more specificly, it cannot be installed with "pip
>>> install MySQL-python".
>>>
>>> I would need this to run Trac 2.2.5 with MariaDB. Under Ubuntu 18.04, I
>>> did exactly the same steps and installation was no problem.
>>>
>>> Is there any way to get Trac running under Ubuntu 20.04 with MariaDB as
>>> a database?
>>> Unfortunately, downgrading our server to Ubuntu 18.04 isn't really an
>>> option...
>>>
>>> Any help appreciated!
>>> Thank you!
>>>
>>
>> Have you considered switching to Trac 1.4.2? The dependency is PyMySQL.
>> We made the switch because MySQLdb is no longer developed.
>>
>> Ryan
>>
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/7fa1fe89-c23e-435b-834d-b335e51f8428n%40googlegroups.com.
Re: Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
On Wed, Mar 17, 2021 at 9:14 AM Andreas <muffelmuff@gmail.com> wrote:

> Hello again,
>
> I do now really have to migrate our database to MariaDB as we have to
> access Trac from another system to read and write data to it.
>
> As the pip-installation is not working anymore, I found a way to install
> python-mysqldb (is this even the right package?!) on Ubuntu 20.04 by
> adding an older repository to my installation with the following commands:
>
> sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main'
> sudo apt update
> sudo apt install -y python-mysqldb
>
> Source:
>
> https://stackoverflow.com/questions/63457213/how-to-install-python-mysqldb-for-python-2-7-in-ubuntu-20-04-focal-fossa
>
> ... but I am still getting the error during Trac migration that says
> "trac.core.TracError: Unsupported database type "mysql".
> Any idea of what coul be wrong / how to install the right package on
> Ubuntu 20.04?
>
> As long as the TracHoursPlugin is not working on Trac 1.4.2, I really need
> to find a way to migrate the older 1.2.2 to MySQL on Ubuntu 20.04...
>
> Thanks for any hints!!
>

I would create a virtualenv and "pip install mysql-python".
https://pypi.org/project/MySQL-python/

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CA%2BBGpn-BDiqoNHWj_%2BKEBd%3Dv5%3DG-65wvfpDaVvDT%2BC-AKauO8A%40mail.gmail.com.
Re: Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
Hey Ryan,

I just tried this, but I'm still getting the same error...
Any other idea?

Thank you!


(env) root@andreas-VirtualBox:/home/andreas/env# pip install MySQL-python
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0
will drop support for Python 2.7 in January 2021. More details about Python
2 support in pip can be found at
https://pip.pypa.io/en/latest/development/release-process/#python-2-support
pip 21.0 will remove support for this functionality.
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip (108 kB)
Building wheels for collected packages: MySQL-python
Building wheel for MySQL-python (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/andreas/env/bin/python -u -c 'import sys, setuptools,
tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';
__file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
bdist_wheel -d /tmp/pip-wheel-vt99l4
cwd: /tmp/pip-install-feS5dG/mysql-python/
Complete output (30 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
-D_FORTIFY_SOURCE=2 -g
-fdebug-prefix-map=/build/python2.7-QDqKfA/python2.7-2.7.18=.
-fstack-protector-strong -Wformat -Werror=format-security -fPIC
-Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
-I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
_mysql.c:44:10: fatal error: my_config.h: No such file or directory
44 | #include "my_config.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for MySQL-python
Running setup.py clean for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
ERROR: Command errored out with exit status 1:
command: /home/andreas/env/bin/python -u -c 'import sys, setuptools,
tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';
__file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
install --record /tmp/pip-record-NNfKPd/install-record.txt
--single-version-externally-managed --compile --install-headers
/home/andreas/env/include/site/python2.7/MySQL-python
cwd: /tmp/pip-install-feS5dG/mysql-python/
Complete output (30 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py ->
build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
-D_FORTIFY_SOURCE=2 -g
-fdebug-prefix-map=/build/python2.7-QDqKfA/python2.7-2.7.18=.
-fstack-protector-strong -Wformat -Werror=format-security -fPIC
-Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
-I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
_mysql.c:44:10: fatal error: my_config.h: No such file or directory
44 | #include "my_config.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/andreas/env/bin/python
-u -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';
__file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
install --record /tmp/pip-record-NNfKPd/install-record.txt
--single-version-externally-managed --compile --install-headers
/home/andreas/env/include/site/python2.7/MySQL-python Check the logs for
full command output.


RjOllos schrieb am Mittwoch, 17. März 2021 um 17:27:03 UTC+1:

> On Wed, Mar 17, 2021 at 9:14 AM Andreas <muffe...@gmail.com> wrote:
>
>> Hello again,
>>
>> I do now really have to migrate our database to MariaDB as we have to
>> access Trac from another system to read and write data to it.
>>
>> As the pip-installation is not working anymore, I found a way to install
>> python-mysqldb (is this even the right package?!) on Ubuntu 20.04 by
>> adding an older repository to my installation with the following commands:
>>
>> sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic
>> main'
>> sudo apt update
>> sudo apt install -y python-mysqldb
>>
>> Source:
>>
>> https://stackoverflow.com/questions/63457213/how-to-install-python-mysqldb-for-python-2-7-in-ubuntu-20-04-focal-fossa
>>
>> ... but I am still getting the error during Trac migration that says
>> "trac.core.TracError: Unsupported database type "mysql".
>> Any idea of what coul be wrong / how to install the right package on
>> Ubuntu 20.04?
>>
>> As long as the TracHoursPlugin is not working on Trac 1.4.2, I really
>> need to find a way to migrate the older 1.2.2 to MySQL on Ubuntu 20.04...
>>
>> Thanks for any hints!!
>>
>
> I would create a virtualenv and "pip install mysql-python".
> https://pypi.org/project/MySQL-python/
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/c70653b5-bc0e-4b56-af66-391d60e63ee7n%40googlegroups.com.
Re: Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
I finally found the solution to install MySQL-python here
<https://stackoverflow.com/questions/62087499/failing-to-install-mysql-python>,
but I do have another problem now while running the migration script...I
guess it doesn't have to do with the migration script as I tried to migrate
in Ubuntu 18.04 (without any errors), exported the MariaDB-database,
imported the database in Ubuntu 20.04, changed the connection string in
trac.ini to mysql and I am getting the following error in the Trac Logfile:

*2021-03-18 10:16:31,836 Trac[main] ERROR: can't retrieve session:
TimeoutError: Unable to get database connection within 0 seconds.
(AttributeError: 'NoneType' object has no attribute 'connect')*

Additionally, I am getting the following warnings in the Browser:

*Warning:*

- Error with navigation contributor "PreferencesModule"
- Error with navigation contributor "BrowserModule"



Does anyone have an idea of what could be wrong? Maybe just a permission
issue somewhere?
I am thankful for every kind of hint!

Thanks!



Migration script error:

./trac-migrate.py --in-place /var/lib/trac/visicon
mysql://tracuser:password@localhost/trac_migrate
Traceback (most recent call last):
File "./trac-migrate.py", line 55, in <module>
sys.exit(main(sys.argv[1:]) or 0)
File "./trac-migrate.py", line 45, in main
if env.needs_upgrade():
File "/usr/local/lib/python2.7/dist-packages/trac/env.py", line 806, in
needs_upgrade
for participant in self.setup_participants:
File "/usr/local/lib/python2.7/dist-packages/trac/core.py", line 95, in
extensions
components = [component.compmgr[cls] for cls in classes]
File "/usr/local/lib/python2.7/dist-packages/trac/core.py", line 238, in
__getitem__
component = cls(self)
File "/usr/local/lib/python2.7/dist-packages/trac/core.py", line 157, in
__call__
self.__init__()
File "build/bdist.linux-x86_64/egg/trachours/db.py", line 45, in __init__
File "build/bdist.linux-x86_64/egg/trachours/db.py", line 104, in version
File "/usr/local/lib/python2.7/dist-packages/trac/db/api.py", line 121,
in execute
with self as db:
File "/usr/local/lib/python2.7/dist-packages/trac/db/api.py", line 174,
in __enter__
db = self.dbmgr.get_connection(readonly=True)
File "/usr/local/lib/python2.7/dist-packages/trac/db/api.py", line 465,
in get_connection
db = self._cnx_pool.get_cnx(self.timeout or None)
File "/usr/local/lib/python2.7/dist-packages/trac/db/pool.py", line 214,
in get_cnx
return _backend.get_cnx(self._connector, self._kwargs, timeout)
File "/usr/local/lib/python2.7/dist-packages/trac/db/pool.py", line 135,
in get_cnx
raise TimeoutError(errmsg)
*trac.db.pool.TimeoutError: Unable to get database connection within 0
seconds. (AttributeError: 'NoneType' object has no attribute 'connect')*



Andreas schrieb am Donnerstag, 18. März 2021 um 07:14:34 UTC+1:

> Hey Ryan,
>
> I just tried this, but I'm still getting the same error...
> Any other idea?
>
> Thank you!
>
>
> (env) root@andreas-VirtualBox:/home/andreas/env# pip install MySQL-python
>
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
> Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0
> will drop support for Python 2.7 in January 2021. More details about Python
> 2 support in pip can be found at
> https://pip.pypa.io/en/latest/development/release-process/#python-2-support
> pip 21.0 will remove support for this functionality.
> Collecting MySQL-python
> Using cached MySQL-python-1.2.5.zip (108 kB)
> Building wheels for collected packages: MySQL-python
> Building wheel for MySQL-python (setup.py) ... error
> ERROR: Command errored out with exit status 1:
> command: /home/andreas/env/bin/python -u -c 'import sys, setuptools,
> tokenize; sys.argv[0] =
> '"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> bdist_wheel -d /tmp/pip-wheel-vt99l4
> cwd: /tmp/pip-install-feS5dG/mysql-python/
>
> Complete output (30 lines):
> running bdist_wheel
> running build
> running build_py
> creating build
> creating build/lib.linux-x86_64-2.7
> copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
> creating build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
> creating build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/__init__.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/CR.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/FIELD_TYPE.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/ER.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/FLAG.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/REFRESH.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/CLIENT.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> running build_ext
> building '_mysql' extension
> creating build/temp.linux-x86_64-2.7
> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
> -D_FORTIFY_SOURCE=2 -g
> -fdebug-prefix-map=/build/python2.7-QDqKfA/python2.7-2.7.18=.
> -fstack-protector-strong -Wformat -Werror=format-security -fPIC
> -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
> -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
> _mysql.c:44:10: fatal error: my_config.h: No such file or directory
> 44 | #include "my_config.h"
> | ^~~~~~~~~~~~~
>
> compilation terminated.
> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
> ----------------------------------------
> ERROR: Failed building wheel for MySQL-python
> Running setup.py clean for MySQL-python
> Failed to build MySQL-python
> Installing collected packages: MySQL-python
> Running setup.py install for MySQL-python ... error
> ERROR: Command errored out with exit status 1:
> command: /home/andreas/env/bin/python -u -c 'import sys, setuptools,
> tokenize; sys.argv[0] =
> '"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> install --record /tmp/pip-record-NNfKPd/install-record.txt
> --single-version-externally-managed --compile --install-headers
> /home/andreas/env/include/site/python2.7/MySQL-python
> cwd: /tmp/pip-install-feS5dG/mysql-python/
>
> Complete output (30 lines):
> running install
> running build
> running build_py
> creating build
> creating build/lib.linux-x86_64-2.7
> copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
> creating build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
> copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
> creating build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/__init__.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/CR.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/FIELD_TYPE.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/ER.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/FLAG.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/REFRESH.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> copying MySQLdb/constants/CLIENT.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> running build_ext
> building '_mysql' extension
> creating build/temp.linux-x86_64-2.7
> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
> -D_FORTIFY_SOURCE=2 -g
> -fdebug-prefix-map=/build/python2.7-QDqKfA/python2.7-2.7.18=.
> -fstack-protector-strong -Wformat -Werror=format-security -fPIC
> -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
> -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
> _mysql.c:44:10: fatal error: my_config.h: No such file or directory
> 44 | #include "my_config.h"
> | ^~~~~~~~~~~~~
>
> compilation terminated.
> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
> ----------------------------------------
> ERROR: Command errored out with exit status 1:
> /home/andreas/env/bin/python -u -c 'import sys, setuptools, tokenize;
> sys.argv[0] = '"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> install --record /tmp/pip-record-NNfKPd/install-record.txt
> --single-version-externally-managed --compile --install-headers
> /home/andreas/env/include/site/python2.7/MySQL-python Check the logs for
> full command output.
>
>
> RjOllos schrieb am Mittwoch, 17. März 2021 um 17:27:03 UTC+1:
>
>> On Wed, Mar 17, 2021 at 9:14 AM Andreas <muffe...@gmail.com> wrote:
>>
>>> Hello again,
>>>
>>> I do now really have to migrate our database to MariaDB as we have to
>>> access Trac from another system to read and write data to it.
>>>
>>> As the pip-installation is not working anymore, I found a way to install
>>> python-mysqldb (is this even the right package?!) on Ubuntu 20.04 by
>>> adding an older repository to my installation with the following commands:
>>>
>>> sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic
>>> main'
>>> sudo apt update
>>> sudo apt install -y python-mysqldb
>>>
>>> Source:
>>>
>>> https://stackoverflow.com/questions/63457213/how-to-install-python-mysqldb-for-python-2-7-in-ubuntu-20-04-focal-fossa
>>>
>>> ... but I am still getting the error during Trac migration that says
>>> "trac.core.TracError: Unsupported database type "mysql".
>>> Any idea of what coul be wrong / how to install the right package on
>>> Ubuntu 20.04?
>>>
>>> As long as the TracHoursPlugin is not working on Trac 1.4.2, I really
>>> need to find a way to migrate the older 1.2.2 to MySQL on Ubuntu 20.04...
>>>
>>> Thanks for any hints!!
>>>
>>
>> I would create a virtualenv and "pip install mysql-python".
>> https://pypi.org/project/MySQL-python/
>>
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/79d7dcad-eabf-4563-bbbb-0c1b6590dd7fn%40googlegroups.com.
Re: Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
trac-migrate.py isn't needed for your case. Instead, use mysqldump.

On Thu, Mar 18, 2021 at 6:42 PM Andreas <muffelmuff@gmail.com> wrote:
>
> I finally found the solution to install MySQL-python here, but I do have another problem now while running the migration script...I guess it doesn't have to do with the migration script as I tried to migrate in Ubuntu 18.04 (without any errors), exported the MariaDB-database, imported the database in Ubuntu 20.04, changed the connection string in trac.ini to mysql and I am getting the following error in the Trac Logfile:
>
> 2021-03-18 10:16:31,836 Trac[main] ERROR: can't retrieve session: TimeoutError: Unable to get database connection within 0 seconds. (AttributeError: 'NoneType' object has no attribute 'connect')
>
> Additionally, I am getting the following warnings in the Browser:
>
> Warning:
>
> Error with navigation contributor "PreferencesModule"
> Error with navigation contributor "BrowserModule"
>
>
>
> Does anyone have an idea of what could be wrong? Maybe just a permission issue somewhere?
> I am thankful for every kind of hint!
>
> Thanks!
>
>
>
> Migration script error:
>
> ./trac-migrate.py --in-place /var/lib/trac/visicon mysql://tracuser:password@localhost/trac_migrate
> Traceback (most recent call last):
> File "./trac-migrate.py", line 55, in <module>
> sys.exit(main(sys.argv[1:]) or 0)
> File "./trac-migrate.py", line 45, in main
> if env.needs_upgrade():
> File "/usr/local/lib/python2.7/dist-packages/trac/env.py", line 806, in needs_upgrade
> for participant in self.setup_participants:
> File "/usr/local/lib/python2.7/dist-packages/trac/core.py", line 95, in extensions
> components = [component.compmgr[cls] for cls in classes]
> File "/usr/local/lib/python2.7/dist-packages/trac/core.py", line 238, in __getitem__
> component = cls(self)
> File "/usr/local/lib/python2.7/dist-packages/trac/core.py", line 157, in __call__
> self.__init__()
> File "build/bdist.linux-x86_64/egg/trachours/db.py", line 45, in __init__
> File "build/bdist.linux-x86_64/egg/trachours/db.py", line 104, in version
> File "/usr/local/lib/python2.7/dist-packages/trac/db/api.py", line 121, in execute
> with self as db:
> File "/usr/local/lib/python2.7/dist-packages/trac/db/api.py", line 174, in __enter__
> db = self.dbmgr.get_connection(readonly=True)
> File "/usr/local/lib/python2.7/dist-packages/trac/db/api.py", line 465, in get_connection
> db = self._cnx_pool.get_cnx(self.timeout or None)
> File "/usr/local/lib/python2.7/dist-packages/trac/db/pool.py", line 214, in get_cnx
> return _backend.get_cnx(self._connector, self._kwargs, timeout)
> File "/usr/local/lib/python2.7/dist-packages/trac/db/pool.py", line 135, in get_cnx
> raise TimeoutError(errmsg)
> trac.db.pool.TimeoutError: Unable to get database connection within 0 seconds. (AttributeError: 'NoneType' object has no attribute 'connect')
>
>
>
> Andreas schrieb am Donnerstag, 18. März 2021 um 07:14:34 UTC+1:
>>
>> Hey Ryan,
>>
>> I just tried this, but I'm still getting the same error...
>> Any other idea?
>>
>> Thank you!
>>
>>
>> (env) root@andreas-VirtualBox:/home/andreas/env# pip install MySQL-python
>>
>> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
>> Collecting MySQL-python
>> Using cached MySQL-python-1.2.5.zip (108 kB)
>> Building wheels for collected packages: MySQL-python
>> Building wheel for MySQL-python (setup.py) ... error
>> ERROR: Command errored out with exit status 1:
>> command: /home/andreas/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-vt99l4
>> cwd: /tmp/pip-install-feS5dG/mysql-python/
>>
>> Complete output (30 lines):
>> running bdist_wheel
>> running build
>> running build_py
>> creating build
>> creating build/lib.linux-x86_64-2.7
>> copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
>> creating build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> creating build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> running build_ext
>> building '_mysql' extension
>> creating build/temp.linux-x86_64-2.7
>> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-QDqKfA/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
>> _mysql.c:44:10: fatal error: my_config.h: No such file or directory
>> 44 | #include "my_config.h"
>> | ^~~~~~~~~~~~~
>>
>> compilation terminated.
>> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
>> ----------------------------------------
>> ERROR: Failed building wheel for MySQL-python
>> Running setup.py clean for MySQL-python
>> Failed to build MySQL-python
>> Installing collected packages: MySQL-python
>> Running setup.py install for MySQL-python ... error
>> ERROR: Command errored out with exit status 1:
>> command: /home/andreas/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-NNfKPd/install-record.txt --single-version-externally-managed --compile --install-headers /home/andreas/env/include/site/python2.7/MySQL-python
>> cwd: /tmp/pip-install-feS5dG/mysql-python/
>>
>> Complete output (30 lines):
>> running install
>> running build
>> running build_py
>> creating build
>> creating build/lib.linux-x86_64-2.7
>> copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
>> creating build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
>> creating build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
>> running build_ext
>> building '_mysql' extension
>> creating build/temp.linux-x86_64-2.7
>> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-QDqKfA/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
>> _mysql.c:44:10: fatal error: my_config.h: No such file or directory
>> 44 | #include "my_config.h"
>> | ^~~~~~~~~~~~~
>>
>> compilation terminated.
>> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
>> ----------------------------------------
>> ERROR: Command errored out with exit status 1: /home/andreas/env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-NNfKPd/install-record.txt --single-version-externally-managed --compile --install-headers /home/andreas/env/include/site/python2.7/MySQL-python Check the logs for full command output.
>>
>>
>> RjOllos schrieb am Mittwoch, 17. März 2021 um 17:27:03 UTC+1:
>>>
>>> On Wed, Mar 17, 2021 at 9:14 AM Andreas <muffe...@gmail.com> wrote:
>>>>
>>>> Hello again,
>>>>
>>>> I do now really have to migrate our database to MariaDB as we have to access Trac from another system to read and write data to it.
>>>>
>>>> As the pip-installation is not working anymore, I found a way to install python-mysqldb (is this even the right package?!) on Ubuntu 20.04 by adding an older repository to my installation with the following commands:
>>>>
>>>> sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main'
>>>> sudo apt update
>>>> sudo apt install -y python-mysqldb
>>>>
>>>> Source:
>>>> https://stackoverflow.com/questions/63457213/how-to-install-python-mysqldb-for-python-2-7-in-ubuntu-20-04-focal-fossa
>>>>
>>>> ... but I am still getting the error during Trac migration that says "trac.core.TracError: Unsupported database type "mysql".
>>>> Any idea of what coul be wrong / how to install the right package on Ubuntu 20.04?
>>>>
>>>> As long as the TracHoursPlugin is not working on Trac 1.4.2, I really need to find a way to migrate the older 1.2.2 to MySQL on Ubuntu 20.04...
>>>>
>>>> Thanks for any hints!!
>>>
>>>
>>> I would create a virtualenv and "pip install mysql-python".
>>> https://pypi.org/project/MySQL-python/
>
> --
> You received this message because you are subscribed to the Google Groups "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/79d7dcad-eabf-4563-bbbb-0c1b6590dd7fn%40googlegroups.com.



--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMaiSh2agH%3DFMh85T7S454%3DoxPpc3qN96vCFqfGpsdKZMSg%40mail.gmail.com.
Re: Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
I used mysqldump to export the db in the old system and imported the
database to the new system afterwards, but now I am getting this error
message in Trac:

*Unable to get database connection within 0 seconds. (AttributeError:
'NoneType' object has no attribute 'connect')*



Jun Omae schrieb am Donnerstag, 18. März 2021 um 11:04:00 UTC+1:

> trac-migrate.py isn't needed for your case. Instead, use mysqldump.
>
> On Thu, Mar 18, 2021 at 6:42 PM Andreas <muffe...@gmail.com> wrote:
> >
> > I finally found the solution to install MySQL-python here, but I do have
> another problem now while running the migration script...I guess it doesn't
> have to do with the migration script as I tried to migrate in Ubuntu 18.04
> (without any errors), exported the MariaDB-database, imported the database
> in Ubuntu 20.04, changed the connection string in trac.ini to mysql and I
> am getting the following error in the Trac Logfile:
> >
> > 2021-03-18 10:16:31,836 Trac[main] ERROR: can't retrieve session:
> TimeoutError: Unable to get database connection within 0 seconds.
> (AttributeError: 'NoneType' object has no attribute 'connect')
> >
> > Additionally, I am getting the following warnings in the Browser:
> >
> > Warning:
> >
> > Error with navigation contributor "PreferencesModule"
> > Error with navigation contributor "BrowserModule"
> >
> >
> >
> > Does anyone have an idea of what could be wrong? Maybe just a permission
> issue somewhere?
> > I am thankful for every kind of hint!
> >
> > Thanks!
> >
> >
> >
> > Migration script error:
> >
> > ./trac-migrate.py --in-place /var/lib/trac/visicon
> mysql://tracuser:password@localhost/trac_migrate
> > Traceback (most recent call last):
> > File "./trac-migrate.py", line 55, in <module>
> > sys.exit(main(sys.argv[1:]) or 0)
> > File "./trac-migrate.py", line 45, in main
> > if env.needs_upgrade():
> > File "/usr/local/lib/python2.7/dist-packages/trac/env.py", line 806, in
> needs_upgrade
> > for participant in self.setup_participants:
> > File "/usr/local/lib/python2.7/dist-packages/trac/core.py", line 95, in
> extensions
> > components = [component.compmgr[cls] for cls in classes]
> > File "/usr/local/lib/python2.7/dist-packages/trac/core.py", line 238, in
> __getitem__
> > component = cls(self)
> > File "/usr/local/lib/python2.7/dist-packages/trac/core.py", line 157, in
> __call__
> > self.__init__()
> > File "build/bdist.linux-x86_64/egg/trachours/db.py", line 45, in __init__
> > File "build/bdist.linux-x86_64/egg/trachours/db.py", line 104, in version
> > File "/usr/local/lib/python2.7/dist-packages/trac/db/api.py", line 121,
> in execute
> > with self as db:
> > File "/usr/local/lib/python2.7/dist-packages/trac/db/api.py", line 174,
> in __enter__
> > db = self.dbmgr.get_connection(readonly=True)
> > File "/usr/local/lib/python2.7/dist-packages/trac/db/api.py", line 465,
> in get_connection
> > db = self._cnx_pool.get_cnx(self.timeout or None)
> > File "/usr/local/lib/python2.7/dist-packages/trac/db/pool.py", line 214,
> in get_cnx
> > return _backend.get_cnx(self._connector, self._kwargs, timeout)
> > File "/usr/local/lib/python2.7/dist-packages/trac/db/pool.py", line 135,
> in get_cnx
> > raise TimeoutError(errmsg)
> > trac.db.pool.TimeoutError: Unable to get database connection within 0
> seconds. (AttributeError: 'NoneType' object has no attribute 'connect')
> >
> >
> >
> > Andreas schrieb am Donnerstag, 18. März 2021 um 07:14:34 UTC+1:
> >>
> >> Hey Ryan,
> >>
> >> I just tried this, but I'm still getting the same error...
> >> Any other idea?
> >>
> >> Thank you!
> >>
> >>
> >> (env) root@andreas-VirtualBox:/home/andreas/env# pip install
> MySQL-python
> >>
> >> DEPRECATION: Python 2.7 reached the end of its life on January 1st,
> 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip
> 21.0 will drop support for Python 2.7 in January 2021. More details about
> Python 2 support in pip can be found at
> https://pip.pypa.io/en/latest/development/release-process/#python-2-support
> pip 21.0 will remove support for this functionality.
> >> Collecting MySQL-python
> >> Using cached MySQL-python-1.2.5.zip (108 kB)
> >> Building wheels for collected packages: MySQL-python
> >> Building wheel for MySQL-python (setup.py) ... error
> >> ERROR: Command errored out with exit status 1:
> >> command: /home/andreas/env/bin/python -u -c 'import sys, setuptools,
> tokenize; sys.argv[0] =
> '"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> bdist_wheel -d /tmp/pip-wheel-vt99l4
> >> cwd: /tmp/pip-install-feS5dG/mysql-python/
> >>
> >> Complete output (30 lines):
> >> running bdist_wheel
> >> running build
> >> running build_py
> >> creating build
> >> creating build/lib.linux-x86_64-2.7
> >> copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
> >> creating build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> creating build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/__init__.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/CR.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/FIELD_TYPE.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/ER.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/FLAG.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/REFRESH.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/CLIENT.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> running build_ext
> >> building '_mysql' extension
> >> creating build/temp.linux-x86_64-2.7
> >> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
> -D_FORTIFY_SOURCE=2 -g
> -fdebug-prefix-map=/build/python2.7-QDqKfA/python2.7-2.7.18=.
> -fstack-protector-strong -Wformat -Werror=format-security -fPIC
> -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
> -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
> >> _mysql.c:44:10: fatal error: my_config.h: No such file or directory
> >> 44 | #include "my_config.h"
> >> | ^~~~~~~~~~~~~
> >>
> >> compilation terminated.
> >> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
> >> ----------------------------------------
> >> ERROR: Failed building wheel for MySQL-python
> >> Running setup.py clean for MySQL-python
> >> Failed to build MySQL-python
> >> Installing collected packages: MySQL-python
> >> Running setup.py install for MySQL-python ... error
> >> ERROR: Command errored out with exit status 1:
> >> command: /home/andreas/env/bin/python -u -c 'import sys, setuptools,
> tokenize; sys.argv[0] =
> '"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> install --record /tmp/pip-record-NNfKPd/install-record.txt
> --single-version-externally-managed --compile --install-headers
> /home/andreas/env/include/site/python2.7/MySQL-python
> >> cwd: /tmp/pip-install-feS5dG/mysql-python/
> >>
> >> Complete output (30 lines):
> >> running install
> >> running build
> >> running build_py
> >> creating build
> >> creating build/lib.linux-x86_64-2.7
> >> copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
> >> creating build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
> >> creating build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/__init__.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/CR.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/FIELD_TYPE.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/ER.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/FLAG.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/REFRESH.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> copying MySQLdb/constants/CLIENT.py ->
> build/lib.linux-x86_64-2.7/MySQLdb/constants
> >> running build_ext
> >> building '_mysql' extension
> >> creating build/temp.linux-x86_64-2.7
> >> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time
> -D_FORTIFY_SOURCE=2 -g
> -fdebug-prefix-map=/build/python2.7-QDqKfA/python2.7-2.7.18=.
> -fstack-protector-strong -Wformat -Werror=format-security -fPIC
> -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql
> -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
> >> _mysql.c:44:10: fatal error: my_config.h: No such file or directory
> >> 44 | #include "my_config.h"
> >> | ^~~~~~~~~~~~~
> >>
> >> compilation terminated.
> >> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
> >> ----------------------------------------
> >> ERROR: Command errored out with exit status 1:
> /home/andreas/env/bin/python -u -c 'import sys, setuptools, tokenize;
> sys.argv[0] = '"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-feS5dG/mysql-python/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> install --record /tmp/pip-record-NNfKPd/install-record.txt
> --single-version-externally-managed --compile --install-headers
> /home/andreas/env/include/site/python2.7/MySQL-python Check the logs for
> full command output.
> >>
> >>
> >> RjOllos schrieb am Mittwoch, 17. März 2021 um 17:27:03 UTC+1:
> >>>
> >>> On Wed, Mar 17, 2021 at 9:14 AM Andreas <muffe...@gmail.com> wrote:
> >>>>
> >>>> Hello again,
> >>>>
> >>>> I do now really have to migrate our database to MariaDB as we have to
> access Trac from another system to read and write data to it.
> >>>>
> >>>> As the pip-installation is not working anymore, I found a way to
> install python-mysqldb (is this even the right package?!) on Ubuntu 20.04
> by adding an older repository to my installation with the following
> commands:
> >>>>
> >>>> sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic
> main'
> >>>> sudo apt update
> >>>> sudo apt install -y python-mysqldb
> >>>>
> >>>> Source:
> >>>>
> https://stackoverflow.com/questions/63457213/how-to-install-python-mysqldb-for-python-2-7-in-ubuntu-20-04-focal-fossa
> >>>>
> >>>> ... but I am still getting the error during Trac migration that says
> "trac.core.TracError: Unsupported database type "mysql".
> >>>> Any idea of what coul be wrong / how to install the right package on
> Ubuntu 20.04?
> >>>>
> >>>> As long as the TracHoursPlugin is not working on Trac 1.4.2, I really
> need to find a way to migrate the older 1.2.2 to MySQL on Ubuntu 20.04...
> >>>>
> >>>> Thanks for any hints!!
> >>>
> >>>
> >>> I would create a virtualenv and "pip install mysql-python".
> >>> https://pypi.org/project/MySQL-python/
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Trac Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to trac-users+...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/trac-users/79d7dcad-eabf-4563-bbbb-0c1b6590dd7fn%40googlegroups.com
> .
>
>
>
> --
> Jun Omae <jun...@gmail.com> (?? ?)
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/6b4951bd-f241-4609-815c-9053d24bf8f5n%40googlegroups.com.
Re: Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
On Thursday, March 18, 2021 at 3:12:23 AM UTC-7 Andreas wrote:

> I used mysqldump to export the db in the old system and imported the
> database to the new system afterwards, but now I am getting this error
> message in Trac:
>
> *Unable to get database connection within 0 seconds. (AttributeError:
> 'NoneType' object has no attribute 'connect')*
>

Did you set the [trac] database connection string?
https://trac.edgewall.org/wiki/TracIni#trac-database-option



--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/35804f62-8130-4d76-b5d4-3b0f4d44e56en%40googlegroups.com.
Re: Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
On Thursday, March 18, 2021 at 2:42:06 AM UTC-7 Andreas wrote:

> I finally found the solution to install MySQL-python here
> <https://stackoverflow.com/questions/62087499/failing-to-install-mysql-python>
> ,
>

To get that header file, you may typically need to install the "source"
version of the package from the package repository.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/5d886075-4cbb-4955-8319-ab3067b063efn%40googlegroups.com.
Re: Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
Hello Ryan,

yes, my connection string looks like this:
database = mysql://tracuser:password@localhost/trac_db

>>"To get that header file, you may typically need to install the "source"
version of the package from the package repository."
What do you mean with that? That I might have the wrong "my_config.h" file?
Which package do you mean?


RjOllos schrieb am Donnerstag, 18. März 2021 um 18:43:57 UTC+1:

> On Thursday, March 18, 2021 at 2:42:06 AM UTC-7 Andreas wrote:
>
>> I finally found the solution to install MySQL-python here
>> <https://stackoverflow.com/questions/62087499/failing-to-install-mysql-python>
>> ,
>>
>
> To get that header file, you may typically need to install the "source"
> version of the package from the package repository.
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/8aa9878e-dbd6-418f-8dd1-2799a06e929en%40googlegroups.com.
Re: Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
On Thursday, March 18, 2021 at 1:12:53 PM UTC-7 Andreas wrote:

> Hello Ryan,
> >>"To get that header file, you may typically need to install the "source"
> version of the package from the package repository."
> What do you mean with that? That I might have the wrong "my_config.h"
> file? Which package do you mean?
>

What you did may work perfectly fine. I haven't used Fedora in years, so
I'm extrapolating off what I know about Debian, but typically you'd get the
headers by installing a -devel package:

$ yum install mariadb-devel

If the extension "-devel" isn't correct, there may be something like "yum
search" that could be used to find the MariaDB package that includes the
header files.

Ryan

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/bc910925-eff9-43ca-bbef-05f79738cf0en%40googlegroups.com.
Re: Re: Trac / MySQL-python on Ubuntu 20.04 [ In reply to ]
Thanks for your hints Ryan; unfortunately, this didn't fix the
problem...but I finally found a solution!

I copied the file my_config.h from an ubuntu 18.04 installation to my
ubuntu 20.04 into /usr/include/mysql and then did pip install MySQL-python
again. The migration script is still not working, so I did the migration in
Ubuntun 18.04, exported the SQL-file, imported the file into MariaDB /
Ubuntu 20.04 and changed the Trac-connection string to mysql. Pretty
complicated, but it's working now ;-)

I attach the my_config.h file here if anyone else tries to use Trac 1.2.x
with MySQL / MariaDB under Ubuntu 20.04 - the file from stackoverflow
doesn't work properly in Ubuntu ;-)
RjOllos schrieb am Freitag, 19. März 2021 um 20:56:07 UTC+1:

>
>
> On Thursday, March 18, 2021 at 1:12:53 PM UTC-7 Andreas wrote:
>
>> Hello Ryan,
>>
>> version of the package from the package repository."
>> What do you mean with that? That I might have the wrong "my_config.h"
>> file? Which package do you mean?
>>
>
> What you did may work perfectly fine. I haven't used Fedora in years, so
> I'm extrapolating off what I know about Debian, but typically you'd get the
> headers by installing a -devel package:
>
> $ yum install mariadb-devel
>
> If the extension "-devel" isn't correct, there may be something like "yum
> search" that could be used to find the MariaDB package that includes the
> header files.
>
> Ryan
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/e29bb087-fce2-435f-81e9-f731d8f28f1bn%40googlegroups.com.