Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image in README.rst not displaying in pypi

I would like an image linked in my README.rst file to be displayed when I upload my package to PyPI. In my README I have:

.. image:: example-python.png
   :height: 100px
   :width: 200px
   :scale: 100 %
   :align: center

and in MANIFEST.in I have:

# Include the image file
include example-python.png

Right now it's not displaying in testpypi. It shows up just fine on GitHub, however. Am I doing something wrong?

like image 974
bexer Avatar asked Feb 24 '16 00:02

bexer


1 Answers

In .. image:: example-python.png you use relative URL, i.e. a browser expects the image in the same directory as the package. I doubt it's possible to upload an image at PyPI. Upload it somewhere and change the URL to be an absolute URL. An image already at Github is ok I think.

include directive in MANIFEST.in doesn't work because it includes the image into source (sdist) archive where browsers will never look it up.

like image 147
phd Avatar answered Nov 01 '22 21:11

phd