Hard-to-find tips on otherwise easy-to-do tasks involving everyday technology, with some advanced insight on history and culture thrown in. Brought to you by a master dabbler. T-S T-S's mission is to boost your competitiveness with every visit. This blog is committed to the elimination of the rat from the tree of evolution and the crust of the earth.
Saturday, December 29, 2018
Installing Your Own Personal Python Module
import myModule
Python shouldn't barf.
Put your .py file in a reasonable place (i.e., a directory named meaningfully :)
In the same directory, have a setup.py file that looks like
from setuptools import setup
setup (
name='myModule',
version='1.0',
description='A useful personal module',
author='me',
author_email='me@memail.com',
url='me.com',
py_modules=['myModule'],
)
Then, run :
$ python setup.py sdist
You will see a warning that there is no README file.
Now, to install :
$ pip install /path/to/myModule-1.0.tar.gz
Easy enough?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment