[MacPorts] #59147: py*-tkinter 3.6.9 is not compatible with virtualenvs

MacPorts noreply at macports.org
Wed Oct 2 13:11:27 UTC 2019


#59147: py*-tkinter 3.6.9 is not compatible with virtualenvs
---------------------+-----------------------------------
 Reporter:  paulray  |      Owner:  (none)
     Type:  defect   |     Status:  new
 Priority:  Normal   |  Milestone:
Component:  ports    |    Version:  2.6.0
 Keywords:           |       Port:  python36 py36-tkinter
---------------------+-----------------------------------
 The preferred way to use virtualenvs is without the --system-site-packages
 so that the virtualenv is encapsulated and installs its own stuff.
 However, if your python code uses tkinter there is a problem.
 The base ports pythonXX do not install tkinter, it is installed by pyXX-
 tkinter.  Unfortunately, this puts _tkinter*.so into the site-packages
 directory, instead of in the main python library directory.  Most python
 installs include tkinter natively and do not require site-packages to see
 it, so this means you can't use tkinter without having site-packags in
 your path (e.g. in a virtualenv).  This would not really be a problem if
 tkinter were installable by pip, since it could just be installed in the
 virtualenv.
 So, I'd like to see one of two solutions implemented:
 * Make pythonXX port install tkinter as part of the base python
 * Or, make pyXX-tkinter create the _tkinter*.so (or a soft link to it) in
 the normal python directory, so that site-packages is not required for
 tkinter to work.
 I'm guessing that the reason that tkinter is a separate port from python
 itself is related to the possible variants for tk (x11, quartz) and/or so
 that python itself does not have a direct tk dependency.

 (Note that I hacked a solution to this problem on my system using this
 command:
 % sudo ln -s
 /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
 /site-packages/_tkinter.cpython-36m-darwin.so
 /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/_tkinter
 .cpython-36m-darwin.so
 Obviously this is not an optimal solution! But if this were done by `port
 install py36-tkinter` all would be good.)

-- 
Ticket URL: <https://trac.macports.org/ticket/59147>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list