I just created a Python package (sources here) but I'm having trouble using it after installation. A simple import gives me an ImportError
.
Below I'll show exactly what I did so that you can reproduce it:
$ git clone git@github.com:kramer65/peewee-versioned.git
Cloning into 'peewee-versioned'
etc. etc.
Checking connectivity... done.
$ virtualenv venv
New python executable in the/path/to/my/venv/bin/python
Installing setuptools, pip, wheel...done.
$ . venv/bin/activate
(venv) $ cd peewee-versioned/
(venv) $ python setup.py install
running install
etc. etc. everything installs without errors
Finished processing dependencies for peewee-versioned==0.1
(venv) $ cd ..
(venv) $ pip freeze
peewee==2.8.0
peewee-versioned==0.1 # AS YOU CAN SEE IT IS INSTALLED
six==1.10.0
(venv) $ python
Python 2.7.10 (default, Oct 23 2015, 18:05:06)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import peewee
>>> import peewee_versioned
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named peewee_versioned
My setup.py looks like this:
from setuptools import setup, find_packages
setup(
name='peewee-versioned',
version='0.1',
packages=find_packages(exclude=['test', 'test.*']),
include_package_data=True,
platforms='any',
install_requires=[
'peewee',
'six'
],
)
and the only relevant file in the project is versioned.py (see the full sources here)
Does anybody have any idea what I'm doing wrong here? All tips are welcome!
[EDIT]
I checked whether there was any egg related to my package in venv site-packages, and there is (check the 5th package):
$ ls -l venv/lib/python2.7/site-packages/
total 512
-rw-r--r-- 1 kramer65 staff 276 13 apr 13:53 easy-install.pth
-rw-r--r-- 1 kramer65 staff 126 13 apr 13:53 easy_install.py
-rw-r--r-- 1 kramer65 staff 367 13 apr 13:53 easy_install.pyc
-rw-r--r-- 1 kramer65 staff 242923 13 apr 13:53 peewee-2.8.0-py2.7.egg
-rw-r--r-- 1 kramer65 staff 970 13 apr 13:53 peewee_versioned-0.1-py2.7.egg
drwxr-xr-x 34 kramer65 staff 1156 13 apr 13:53 pip
drwxr-xr-x 10 kramer65 staff 340 13 apr 13:53 pip-8.1.1.dist-info
drwxr-xr-x 6 kramer65 staff 204 13 apr 13:53 pkg_resources
drwxr-xr-x 52 kramer65 staff 1768 13 apr 13:53 setuptools
drwxr-xr-x 12 kramer65 staff 408 13 apr 13:53 setuptools-20.7.0.dist-info
drwxr-xr-x 5 kramer65 staff 170 13 apr 13:53 six-1.10.0-py2.7.egg
drwxr-xr-x 32 kramer65 staff 1088 13 apr 13:53 wheel
drwxr-xr-x 11 kramer65 staff 374 13 apr 13:53 wheel-0.29.0.dist-info
So why oh why can't I import it?