1

I'm making a program that uses PyMySql and I'd like people to be able to run my program without going through the manual installation of PyMySql, is there a way I can achieve that?

I've already tried compiling to .pyc but that doesn't seem to work, in fact when I uninstall PyMySql it doesn't work anymore.

PS: There probably are better languages to do that but it's a homework assignment for school and can't use anything but python, also sorry for my bad english

Elia Perantoni
  • 581
  • 1
  • 6
  • 19
  • 1
    You could use [pyinstaller](http://www.pyinstaller.org/) or [py2exe](http://www.py2exe.org/), but it sounds like the assignment wants you to complete the task without using any 3rd party packages. Maybe they want you to use [sqllite3](https://docs.python.org/3.6/library/sqlite3.html) which is a built-in module? – pbreach Jan 31 '17 at 18:10
  • @pbreach I need to work with remote databases, I think sqllite3 can't do that – Elia Perantoni Jan 31 '17 at 18:30

2 Answers2

2

Since PyMySQL has MIT license, you can redistribute it without any legal issues and also is a pure python implementation so it doesn't matter on which operative system it runs.

Just go to your python library folder and look for the module folder and copy it to your project folder, after that you can uninstall and python should be able to import it from your project folder and you just need to send your assignment with the module included.

The python library folder varies depending on your operative system, you can look at this answer on how to find the module location.

Community
  • 1
  • 1
Dalvenjia
  • 1,953
  • 1
  • 12
  • 16
0

Use cx_freeze, pyinstaller or virtualenv. Or copy code and put in your. Read python import