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

pip install doesn't install local package fully. #4810

Closed
eromoe opened this issue Oct 25, 2017 · 5 comments
Closed

pip install doesn't install local package fully. #4810

eromoe opened this issue Oct 25, 2017 · 5 comments
Labels
auto-locked Outdated issues that have been locked by automation type: support User Support

Comments

@eromoe
Copy link

eromoe commented Oct 25, 2017

  • Pip version: 9.0.1
  • Python version: 2.7.6
  • Operating system: ubuntu 14.04 in docker

Description:

My project structure

basin-textminer:

image

basin-textminer/textminer :

image

If I used pip install -e basin-textminer/ , I can from textminer.db import xxxx
image

But if I used pip install basin-textminer/ , from textminer.db import xxxx would get error ImportError: No module named db

image

My setup.py doesn't exclude any folders, only assign packages:

    packages=['textminer'],
@eromoe eromoe changed the title pip install doesn't install full package. pip install doesn't install local package fully. Oct 25, 2017
@pradyunsg pradyunsg added type: bug A confirmed bug or unintended behavior type: support User Support labels Oct 25, 2017
@cryvate
Copy link

cryvate commented Nov 12, 2017

Is there a __init__py in ``basin-textminer/textminer/db?

@eromoe
Copy link
Author

eromoe commented Nov 14, 2017

@cryvate
Yes.
And do you mean pip install -e can load module without __init__.py ?
image

@pfmoore
Copy link
Member

pfmoore commented Nov 14, 2017

This sounds like a general issue with how you're packaging your project (i.e., a problem in your setup.py or MANIFEST.in file). As such, it's not a pip issue and you'd be better asking on a more suitable forum like python-list.

@pradyunsg pradyunsg removed the type: bug A confirmed bug or unintended behavior label Nov 14, 2017
@eromoe
Copy link
Author

eromoe commented Nov 15, 2017

This is whole setup.py :

from __future__ import unicode_literals, print_function, absolute_import

import sys
from setuptools import setup, find_packages
from codecs import open
import os

install_requires = open('requirements.txt').read().split('\n')

setup(
    name='textminer',

    description='textminer',

    author='mithril',

    classifiers=[
        'Development Status :: 4 - Beta',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',

        'License :: OSI Approved :: Apache Software License',

        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Environment :: Web Environment',

        'Topic :: Software Development :: Libraries :: Application Frameworks',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],

    keywords='',

    packages=['textminer'],

    install_requires=install_requires,

)

@pfmoore
I don't see there is any strange setting in my setup.py. Could you explain why pip install -e act different as pip install in my situation ?

@pradyunsg
Copy link
Member

Hi @eromoe!

I suggest you run python setup.py sdist and then inspect the contents of the *.tar.gz file that is generated in the dist/ folder. I think there'll be files missing in that. If so, they'll be missing in the installed distribution as installed by pip install ..

The right place to ask why it is so and how to fix it would be python-list (mailing list) or #python on Freenode (IRC); this issue tracker is definitely not the right place. :)


None the less, some things I'd like to point out:

packages=['textminer'],

The subpackages of textminer are not being installed. You should probably just do find_packages() here instead.

install_requires = open('requirements.txt').read().split('\n')

Please don't do this. https://packaging.python.org/discussions/install-requires-vs-requirements/

@eromoe eromoe closed this as completed Nov 21, 2017
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: support User Support
Projects
None yet
Development

No branches or pull requests

4 participants