MrIcyBalls
MrIcyBalls

Reputation: 83

Install a package that is only one Python file and has no setup.py

How can i install a python package that does not have a setup.py file to call. I want to install a package that it happens to be only a .py.

Do i just save it as a .py and put it somewhere in the directory and then import it?

For example the zipfile package and the ElementTree XML parser

P.S.: I have Python-3.x

Upvotes: 0

Views: 207

Answers (2)

Holt
Holt

Reputation: 37606

Edit: As said in the comments, these packages come with Python 3 so you should not install them manually (and certainly not the 2.7 versions). I let my answer bellow for people wanting to install custom package.

On a python interpreter, if you run:

>>> import sys
>>> sys.path

You will see a list of folder where your python executable search for module. You can put your file either in the site-packages folder or the lib folder.

Upvotes: 1

pancakes
pancakes

Reputation: 712

Just put the file somewhere in PYTHONPATH.

Upvotes: 0

Related Questions