Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'spirit' #73

Closed
gogobook opened this issue Sep 10, 2015 · 5 comments
Closed

ImportError: No module named 'spirit' #73

gogobook opened this issue Sep 10, 2015 · 5 comments
Labels

Comments

@gogobook
Copy link

I got 'spirit' by 'git clone', and then follow instructions in README.md. Then I got this error. I know this about 'PYTHONPATH'. And I got the solution by make an soft link in PYTHONPATH. So I think it maybe a document issue.

@nitely
Copy link
Owner

nitely commented Sep 10, 2015

I got 'spirit' by 'git clone', and then follow instructions in README.md.

I'm guessing the main README.md, you should follow the example readme

So I think it maybe a document issue.

Yes, the pip install -r requirements.txt step should be pip install django-spirit, no cloning required. I'll fix it ASAP.

And I got the solution by make an soft link in PYTHONPATH

This is how modules get imported twice and weird bugs happens.

On a side note, if you really want to clone the project and don't want to use pip (ie: to collaborate on the project), your project layout should be as follows:

Spirit/
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        wsgi.py
    myapp/
        ...
    spirit/
        ...

git clone and copy&paste the manage.py from the example folder in to the root project (Spirit/).

@gogobook
Copy link
Author

Thank you @nitely. But installed by pip install django-spirit won't have "example" directory. After 'pip install django-spirit', shoud I use 'django-admin startproject mysite' to start project? And what I need to do to run 'python manage.py spiritinstall'? Sorry, that's a lot questions to bother you.

@nitely
Copy link
Owner

nitely commented Sep 12, 2015

Following the example readme should work for you.
Since the example is a project, you don't need to create one.

The main readme steps are to integrate Spirit into an existing project. The
above solution is shorter than starting a django project, etc but both
should work the same.

El sáb., sept. 12, 2015 5:46 AM, gogobook notifications@github.com
escribió:

Thank you @nitely https://github.com/nitely. But installed by pip
install django-spirit won't have "example" directory. After 'pip install
django-spirit', shoud I use 'django-admin startproject mysite' to start
project? And what I need to do to run 'python manage.py spiritinstall'?
Sorry, that's a lot questions to bother you.


Reply to this email directly or view it on GitHub
#73 (comment).

nitely added a commit that referenced this issue Sep 13, 2015
@gogobook
Copy link
Author

I found the 'example' directory in site-packages when installed spirit by 'pip install django-spirit'. I thought 'example' maybe need to change to another name, like 'django-spirit-example'. And there is no 'manage.py' in the 'example'. How I need to do is better? Copy it from other place?

@nitely
Copy link
Owner

nitely commented Sep 14, 2015

I found the 'example' directory in site-packages when installed spirit by 'pip install django-spirit'

That happens when you install via pip install .

And there is no 'manage.py' in the 'example'. How I need to do is better? Copy it from other place?

Ignore that folder. Go to: https://github.com/nitely/Spirit/tree/master/example and follow the instructions to the letter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants