id summary reporter owner description type status priority milestone component version resolution keywords cc port 59147 py*-tkinter 3.6.9 is not compatible with virtualenvs paulray jmroot "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.)" defect closed Normal ports 2.6.0 fixed rieder python27 python35 python36 python37 py-tkinter