Repository: kivy/kivy

Issue:
No module named kivy.setupconfig
Hi,

When installing Kivy 1.9.1 as a dependency of one of my packages I get the error
`ImportError: No module named 'kivy.setupconfig`.

My setup.py file looks like this and installs without errors:

```
from setuptools import setup
CYTHON_REQ = "cython==0.23.4"
setup(
    name = 'MyApp',
    version = "0.1.0",
    author = "MelleB",
    setup_requires = [ CYTHON_REQ ],
    install_requires = [ CYTHON_REQ, 'kivy==1.9.1' ]
)
```

During the build, the following line is displayed:
`Updated /tmp/easy_install-4drozlb6/kivy-1.9.1/kivy/setupconfig.py`

After digging into  kivy's setup.py, I noticed the setupconfig.py file is generated. 
From my understanding it seems the setupconfig.py isn't part of the mItanifest.

A possible solution might be to add a 'setupconfig.py' entry to the setup's package_data (In https://github.com/kivy/kivy/blob/fddade6ce3b8a3be77d22cd3f973c9c930799874/setup.py#L959)

I found a possibliy related bug + PR in #2850
# Environment

Platform: Ubuntu 16.04LTS
Kivy: 1.9.1
Python: 3.5.1
# Steps to reproduce

```
$ pyenv intall 3.5.1
$ pyenv virtualenv 3.5.1 kivy-setupconfig-issue
$ mkdir kivy-setupconfig-issue && cd kivy-setupconfig-issue
$ pyenv local kivy-setupconfig-issue
$ cat > setup.py
from setuptools import setup
CYTHON_REQ = "cython==0.23.4"
setup(
    name = 'MyApp',
    version = "0.1.0",
    author = "MelleB",
    setup_requires = [ CYTHON_REQ ],
    install_requires = [ CYTHON_REQ, 'kivy==1.9.1' ]
)

$ python setup.py install
```

After that, the issue can be confirmed with:

```
$ python
Python 3.5.1 (default, May 30 2016, 14:49:00) 
[GCC 5.3.1 20160413] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import kivy
[INFO              ] [Logger      ] Record log in /home/melle/.kivy/logs/kivy_16-06-02_1.txt
[INFO              ] [Kivy        ] v1.9.1
[INFO              ] [Python      ] v3.5.1 (default, May 30 2016, 14:49:00) 
[GCC 5.3.1 20160413]
>>> import kivy.setupconfig
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 ImportError: No module named 'kivy.setupconfig'
>>>
```

If you have any further questions, please let me know.



Discussion:
Note, direct checkout + install does not show the error, which is... weird??

```
$ git clone https://github.com/kivy/kivy.git
$ cd kivy
$ pyenv virtualenv kivy-setupconfig-issue
$ python setup.py install
$ python
Python 3.5.1 (default, May 30 2016, 14:49:00) 
[GCC 5.3.1 20160413] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import kivy
[WARNING           ] [Config      ] Older configuration version detected (14 instead of 15)
[WARNING           ] [Config      ] Upgrading configuration in progress.
[INFO              ] [Logger      ] Record log in /home/melle/.kivy/logs/kivy_16-06-02_2.txt
[INFO              ] [Kivy        ] v1.9.2-dev0
[INFO              ] [Python      ] v3.5.1 (default, May 30 2016, 14:49:00) 
[GCC 5.3.1 20160413]
>>> import kivy.configsetup
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 ImportError: No module named 'kivy.configsetup'
>>> import kivy.setupconfig
>>>  
```

HTH...

Hi, 
Have you solved your problem ? I've the same error with python2.7 and Ubuntu 14.04.4 LTS. 
I've tried some other solutions without success. I'm actually searching a the setupconfig.py to put it manually in the right repository.  

@SebSeb93: My solution was to build from source as I mentioned in https://github.com/kivy/kivy/issues/4350#issuecomment-223264135

(Hit the "Close and comment" button instead of the "Comment" button)

I am getting exactly the same error message right now on OpenSUSE 42.1, no matter if I clone and build manually, install the openSUSE package, or use easy_install.
I just managed to get Kivy running under Python 3 in OpenSUSE: I manually copied setupconfig.py from the repo into the directory that easy_install put all the kivy *.py files in. That seems to work so far.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Still seeing this issue with Kivy 1.10.0 installed via pip. I've actually had quite the headache trying to get my little kivy app working on ReadTheDocs because of how difficult kivy is to install correctly.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1019,6 +1019,7 @@ def get_extensions_from_sources(sources):
         ],
         package_dir={'kivy': 'kivy'},
         package_data={'kivy': [
+            'setupconfig.py'
             '*.pxd',
             '*.pxi',
             'core/text/*.pxd',


Test patch: