Page MenuHomePhabricator

install pymysql on tools-bastion-03
Closed, ResolvedPublic


I apologize if his is not the right process.

With reference to T142021, Pywikibot is going to use PyMySql.
Is it possible to install it on tools-bastion-03 (and other tool-labs environments if needed), both python2 and python3 versions?


Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bd808 added a subscriber: bd808.

@Mpaa can this python package not be installed in a python virtualenv local to the tool?

I think in the long term, if pywikibot starts to prefer pymysql as the solution to access databases, having a global pymysql install can make a less steep learning curve. Also considering the number of users that will need it, why not? After all, we even ported python2 oursql to aptly (T51063)

10:35:11 0 ✓ zhuyifei1999@tools-bastion-02: ~$ apt-cache search 'oursql|pymysql|mysqldb'
python-mysqldb - Python interface to MySQL
python-mysqldb-dbg - Python interface to MySQL (debug extension)
bibus - bibliographic database
mysql-utilities - collection of scripts for managing MySQL servers
python-oursql - MySQL bindings for python.
python-pymysql - Pure-Python MySQL driver - Python 2.x
python3-pymysql - Pure-Python MySQL Driver - Python 3.x
10:35:45 0 ✓ zhuyifei1999@tools-bastion-02: ~$ apt-cache policy python-mysqldb python-oursql python{,3}-pymysql
  Installed: 1.2.3-2ubuntu1
  Candidate: 1.2.3-2ubuntu1
  Version table:
 *** 1.2.3-2ubuntu1 0
        500 trusty/main amd64 Packages
        100 /var/lib/dpkg/status
  Version table:
 *** 0
       1500 trusty-tools/main amd64 Packages
        100 /var/lib/dpkg/status
  Installed: (none)
  Candidate: 0.6.2-2
  Version table:
     0.6.2-2 0
       1001 trusty-wikimedia/universe amd64 Packages
  Installed: (none)
  Candidate: 0.7.2-1
  Version table:
     0.7.2-1 0
       1001 trusty-wikimedia/universe amd64 Packages

And we don't have a global python 3 solution to access the databases.

Though, it would be better if we can get PAWS to work better...

@bd808, zhuyifei1999 answered for me.

Change 416874 had a related patch set uploaded (by Zhuyifei1999; owner: Zhuyifei1999):
[operations/puppet@production] toollabs: install python{,3}-pymysql on exec_environ

Dvorapa raised the priority of this task from Low to Medium.Jun 11 2018, 9:39 AM
Dvorapa moved this task from Waiting on other changes to Needs Review on the Pywikibot board.
Dvorapa moved this task from Needs Review to Upstream issues on the Pywikibot board.

I tried this workaround, but I could not manage to run any Pywikibot script from venv (File not found error).

Worked for me.
Can you list what you did and what error you get?

Change 416874 merged by Andrew Bogott:
[operations/puppet@production] toollabs: install python{,3}-pymysql on exec_environ

@Mpaa I followed the manual here (and also other similar manuals to work with venv in Toollabs). When calling Pywikibot from venv shell, it errored like this: File not found in /shared/pywikibot/core/ directory or something similar. No way how to run any Pywikibot script from inside the venv shell worked for me.

Dvorapa claimed this task.
Dvorapa reassigned this task from Dvorapa to Andrew.

OK, then it worked as I had a local 'core' copy, maybe?

This task is only about Toolforge, no?

I meant a local 'core' in mpaa@tools-bastion-03:~$

I used local core folders and files symlinks to the shared core. But I'm not sure why this should matter?