Python Forum
pymysql on macos seirra - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: pymysql on macos seirra (/thread-5046.html)



pymysql on macos seirra - tony1812 - Sep-15-2017

hello, I downloaded pymysql.tar.gz. I am wondering on macos seirra, which directory does it goes in? I try to stick with python3. Anbd also, do I need to do any manual configuration on mysql and/or apache? thanks.


RE: pymysql on macos seirra - Larz60+ - Sep-15-2017

You're better off downloading the wheel: https://pypi.python.org/packages/c6/42/c54c280d8418039bd2f61284f99cb6d9e0eae80383fc72ceb6eac67855fe/PyMySQL-0.7.11-py2.py3-none-any.whl#md5=021126da545c80000f352882b831f97d
If you do this, then once downloaded:
  • cd to the directory containing the wheel file
  • using cmndr or other terminal software, type:
    pip install wheelname



RE: pymysql on macos seirra - tony1812 - Sep-16-2017

Thanks for the reply.
I am not sure I understand what you mean. Anyhow, I wrote a python3 script that uses pymysql but it was running in Linux. Now I want it to be able to run on my Mac as well, I am stuck because I don't have pymysql on the Mac's weberver installation. I google it but ther doesn't seen to have a comprehensive totural abot it. I am not sure on the where the installation directory should be and if there are any configuration I need to edit on the Mac. And also the terminologies on the net confuse me a bit, are python-mysql, python-mysqldb, pymysql all mean the samething?


RE: pymysql on macos seirra - Larz60+ - Sep-16-2017

Does the apple have pip?

You shouldn't have to worry about the destination directory.
when you install pymysql it will be automatically placed in the proper directory.


RE: pymysql on macos seirra - tony1812 - Sep-17-2017

Thank you for the replay.
Actully, I just realised that pymysql are both /usr/local/lib/python3.6/site-packages/ and /Library/Python/2.7/site-packages/ directories.
However when I do import pymysql, the Mac terninal does n't find it. Is there something with the socket or something like that I need to config?


RE: pymysql on macos seirra - Larz60+ - Sep-17-2017

I'm not familiar with apple, but there is a path associated with python (main directory)
on other OS's. Python knows where the site-packages directory is located.