1

I have a problem with pip && setuptools. I have a simple project here: https://github.com/rmuslimov/rapidlog

If I make these commands:

mkvirtualenv rtests
pip install git+file:///%path_to_this_project%
rapidagent # This my app in this project

It works properly and creates templates and static files.

If I do:

mkvirtualenv rtests
cd %path_to_this_project%
python setup.py install
rapidagent

It cannot install my templates and static files data. So I can't start my application.

Here is the end of my setup.py file:

entry_points={
    'console_scripts': [
        'rapidagent = rapidlog.web.webagent:main'
        ],
    },
include_package_data=True,
data_files=[('rapidlog/web/templates', ['rapidlog/web/templates/index.html']),
            ('rapidlog/web/static/css', glob('rapidlog/web/static/css/*')),
            ('rapidlog/web/static/images', glob('rapidlog/web/static/images/*')),
            ('rapidlog/web/static/js', glob('rapidlog/web/static/js/*')),
            ],
install_requires=[
    'pika>=0.9.5',
    'tornado>=2.3',
    'wsgiref>=0.1.2',
],
classifiers=[
    'License :: OSI Approved :: BSD License',
    'Programming Language :: Python'
    ]

What special command does pip call ? What is the better way to solve this?

3
  • 1
    I just did what you say you did and it all works here. Check my output: gist.github.com/3185285 Commented Jul 26, 2012 at 23:52
  • Can you check in browser localhost:6673 - after rapidagent started? Commented Jul 27, 2012 at 10:31
  • Oh, sorry. It says it can't find the templates and etc. I took a look at site-packages and your package was an .egg zip file. I think the first thing to try is to add zip_safe=False to your setup call. The next is creating a MANIFEST.in file instead of using data_files. Commented Jul 27, 2012 at 13:11

1 Answer 1

1

I find out that your os.path.join calls are relative to the current directory your python is called. So, the first thing is:

web/webagent.py: Change os.path.join('templates') and os.path.join('static') to be absolute

I just sent your a pull request with this change.

Update me with your next steps.

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

Comments

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.