Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File.open(readme) in setup.py isn't found

Tags:

python

The setup.py file in a Python package I've sent to pip:

#!/usr/bin/env python

from distutils.core import setup

setup(
    #......
    long_description=open('README.md').read(),
    #....
)

The file README.md exists. When put a breakpoint in setup.py and execute it locally, it reads the file well. However, when I install it from pip (pip install my_lib), it throws an exception during the installation that it's not found:

File "/private/var/folders/ty/0nvksfhn29z_cjb6md2t3x8c0000gn/T/pip_build_alex/my_app123/setup.py", line 14, in <module>
        long_description=open('README.md').read(),
    IOError: [Errno 2] No such file or directory: 'README.md'
    Complete output from command python setup.py egg_info:

UPDATE:

I just downloaded my library from pip, unzipped and discovered that the file README, LICENCE, MANIFEST aren't in it. And they're in gitignore either because they exist at github.

like image 845
Incerteza Avatar asked Mar 19 '15 17:03

Incerteza


1 Answers

I needed to create MANIFEST.in with the following content:

include README.md
include LICENSE.txt
like image 71
Incerteza Avatar answered Nov 13 '22 07:11

Incerteza