简体   繁体   中英

Python pip install: error: package directory 'b' does not exist

I am making a simple proof of concept example for my thesis about python package distribution. I am stuck on example where I want to install a simple package.

Folder and files layout is the following:

baseApp/
├── baseApp
│   ├── app.py
│   └── __init__.py
├── __init__.py
└── setup.py

File setup.py contains:

from setuptools import setup, find_packages

setup(
    name='BaseApp',
    version='1.0',
    packages="baseApp",
    entry_points={
        'console_scripts': [
            'baseApp=baseApp.app:main '
        ]
    }
)

File app.py is simple file with one function:

def main():
    print("main function")

My idea was to install this package using pip , but running pip install ./baseApp always gives error message:

running install
running bdist_egg
running egg_info
creating BaseApp.egg-info
writing BaseApp.egg-info/PKG-INFO
writing dependency_links to BaseApp.egg-info/depjjjendency_links.txt
writing entry points to BaseApp.egg-info/entry_points.txt
writing top-level names to BaseApp.egg-info/top_level.txt
writing manifest file 'BaseApp.egg-info/SOURCES.txt'
error: package directory 'b' does not exist

Even trying to navigate into the folder and then running python setup.py install gives me the same error. What bothers me the most is that I don't understand what the error message was trying to say to me. I don't see any directory called b nor the reason why there shold be one.

I also tried using virtual environment and system distribution, but both resulted in same error message.

My question is what causes this behaviour and is there any easy way to solve it or am I missing something?

就我而言,我遇到了同样的问题,因为软件包没有完全安装,所以我再次安装了它,然后一切顺利

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM