0

I am having a fair bit of trouble setting up my python package.

I am trying to make it installable via pip by using PYPI.

This is what my project structure looks like:

     |-scum
      \
       | LICENSE
       | MANIFEST
       | README.md
       | README.rst
       | scum
       | scum.py
       | setup.py
       |
       |- |modules
       |   \ 
       |    | __init__.py
       |    | browse.py
       |    | popup.py
       |    | term.py
       |
       |- |resources
       |   \  
       |    | config.txt
       |    | help.txt
       |    | start_up.txt
       |    | tabs.dat

I need to be able to import the files in modules and I need my main file scum.py to be able to access the files in resources

This is my setup.py:

import sys

from distutils.core import setup

from pkgutil import walk_packages

import modules
import resources

if sys.version_info[0] < 3:
    sys.exit("Scum requires Python 3.")

VERSION = '0.2'

setup_kwargs = {
    "version": VERSION,
    "description": 'Scum text editor',
    "author": 'Christian Careaga',
    "author_email": '[email protected]',
    "url": 'https://github.com/CCareaga/scum',
    "download_url": "https://github.com/CCareaga/scum/zipball/" + VERSION,
   "classifiers": [
    "License :: OSI Approved :: MIT License",
    "Intended Audience :: Developers",
    "Programming Language :: Python :: 3",
    "Topic :: Utilities",
    "Topic :: Text Editors",
    ],
   "data_files": [("", ['README.rst']),
               ("resources", ['config.txt', 'help.txt', 'start_up.txt', 'tabs.dat'])]
}


if __name__ == '__main__':
    setup(
        name='scum',
        py_modules=['scum'],
        scripts=['scum'],
        packages = ['modules'],
        include_package_data=True,
        long_description=open('README.rst').read(),
        **setup_kwargs
        )

This setup.py file is not working, I changed a few things since I tested it but I can't figure out how to upload a new version of my package with out creating a whole new tag and release number.

Any help would be appreciated, I have had trouble finding good documentation on this that isn't for very basic packages.

2
  • What error do you get? And from where? Commented Dec 16, 2016 at 10:43
  • @RichArt Well, I can register and upload it but then when I try to install I was getting an error saying that there was no module resources, so I took that out of course. Now i tried to re-upload and pip tells me there is no version matching for what I am requesting (v0.2) but it is on the pypi site. I basically need to be guided through this because I can't seem to figure it out... Commented Dec 16, 2016 at 10:52

1 Answer 1

1

I had not the same problem, but a similar one. To solve it I just deleted the PyPi release and also deleted the auto generated files by the setup.py file (I had several version files in a folder) and just re-uploaded everything with twine.

You may try it out, but I guess you also have to change the version number!

See also my answer here: PyPI 400 upload error . It may help you.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, this is helpful! I figured I could just clear it out and re-upload. I also figured out that I can just run python setup.py install and it will do the same thing pip would do. Now I am getting some pretty odd errors coming from actually running the program...
Oh! I got it working! the script was being run by bash rather than python I think... I need #!/usr/bin/env python... silly me! Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.