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

Build fails if using namespace packages #649

Closed
remram44 opened this issue Oct 26, 2015 · 5 comments
Closed

Build fails if using namespace packages #649

remram44 opened this issue Oct 26, 2015 · 5 comments
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity

Comments

@remram44
Copy link

I have two libs that share a namespace package, and one of them depends on the other.

When building the one that has the dependency, the build fails with "OSError: File exists: <path to the namespace directory>". It looks like you are not handling the fact that the directory will already have been created while installing the first package.

Traceback (most recent call last):
  File "/Users/remirampin/anaconda/bin/conda-build", line 5, in <module>
    sys.exit(main())
  File "/Users/remirampin/anaconda/lib/python2.7/site-packages/conda_build/main_build.py", line 190, in main
    args_func(args, p)
  File "/Users/remirampin/anaconda/lib/python2.7/site-packages/conda_build/main_build.py", line 468, in args_func
    args.func(args, p)
  File "/Users/remirampin/anaconda/lib/python2.7/site-packages/conda_build/main_build.py", line 391, in execute
    override_channels=args.override_channels, include_recipe=args.include_recipe)
  File "/Users/remirampin/anaconda/lib/python2.7/site-packages/conda_build/build.py", line 455, in build
    post_process(sorted(files2 - files1), preserve_egg_dir=bool(m.get_value('build/preserve_egg_dir')))
  File "/Users/remirampin/anaconda/lib/python2.7/site-packages/conda_build/post.py", line 148, in post_process
    remove_easy_install_pth(files, preserve_egg_dir=preserve_egg_dir)
  File "/Users/remirampin/anaconda/lib/python2.7/site-packages/conda_build/post.py", line 105, in remove_easy_install_pth
    utils.copy_into(join(egg_path, fn), join(sp_dir, fn))
  File "/Users/remirampin/anaconda/lib/python2.7/site-packages/conda_build/utils.py", line 34, in copy_into
    shutil.copytree(srcname, dstname)
  File "/Users/remirampin/anaconda/lib/python2.7/shutil.py", line 177, in copytree
    os.makedirs(dst)
  File "/Users/remirampin/anaconda/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '/Users/remirampin/anaconda/envs/_build/lib/python2.7/site-packages/reprounzip/unpackers'
@remram44
Copy link
Author

Bump. Please look into this, still happening, super annoying.

remram44 added a commit to VIDA-NYU/reprozip that referenced this issue Mar 11, 2016
This reverts commit 4e601f9.

This works around conda/conda-build#649.
@kalefranz
Copy link
Contributor

The python community has abandoned namespace packages. Because getting them to work is super annoying.

Honestly, the user experience here has always been broken. And it's not conda's place--being a language-agnostic package manager--to fix it for the PyPA. (Nor do we even have the authority to.)

Rant over. You have a point. Conda can do better. And this issue should stay open as a bug until we can address it further.

@remram44
Copy link
Author

Well, at least installing such packages work with other tools (e.g. pip).

Here's my workaround (commit): remove build dependencies in the conda recipe (since conda will break if installing them) and pass --single-version-externally-managed to setup.py

@ivan-kalev
Copy link
Contributor

@remram44 adding preserve_egg_dir: yes to your recipe should do the trick. On Python 3 you can now use native PEP420 namespace packages (once #1090 is released).

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label May 16, 2022
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Jun 15, 2022
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Jun 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
None yet
Development

No branches or pull requests

3 participants