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

AttributeError: 'set' object has no attribute 'get' when passing package_dir argument to setup() #153

Closed
ghost opened this issue Feb 19, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 19, 2014

Originally reported by: Piotr_Dobrogost (Bitbucket: Piotr_Dobrogost, GitHub: Unknown)


pdobrogost@igo-www-dev:~/tmp/x$ which python && python --version && which easy_install && easy_install --version
/opt/python/2.7/bin/python
Python 2.7.6
/opt/python/2.7/bin/easy_install
setuptools 2.1
pdobrogost@igo-www-dev:~/tmp/x$ ls
packageX  setup.py
pdobrogost@igo-www-dev:~/tmp/x$ ls packageX/
__init__.py  test.txt
pdobrogost@igo-www-dev:~/tmp/x$ cat setup.py
from setuptools import setup

setup(
    name="packageX",
    version='1.0',
    package_dir = {'', 'packageX'},
    package_data = {
        '': ['*.txt'],
    },
    zip_safe=False,
)
pdobrogost@igo-www-dev:~/tmp/x$ python setup.py bdist_egg
running bdist_egg
Traceback (most recent call last):
  File "setup.py", line 10, in <module>
    zip_safe=False,
  File "/opt/python/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/opt/python/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/opt/python/2.7/lib/python2.7/distutils/dist.py", line 971, in run_command
    cmd_obj.ensure_finalized()
  File "/opt/python/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 104, in finalize_options
  File "/opt/python/2.7/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
    cmd_obj.ensure_finalized()
  File "/opt/python/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 80, in finalize_options
AttributeError: 'set' object has no attribute 'get'
pdobrogost@igo-www-dev:~/tmp/x$

@ghost
Copy link
Author

ghost commented Jul 1, 2014

Original comment by didorothy (Bitbucket: didorothy, GitHub: didorothy):


In your above post you have:

#!python

package_dir = {'', 'packageX'},

This line should read:

#!python

package_dir = {'': 'packageX'},

I ran into this exact error and this was the solution for me. It might be nice if the error was more helpful about what was wrong.

@ghost
Copy link
Author

ghost commented Jul 1, 2014

Original comment by Piotr_Dobrogost (Bitbucket: Piotr_Dobrogost, GitHub: Unknown):


@didorothy

Thanks!

@ghost
Copy link
Author

ghost commented Jul 2, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


I looked into providing a nicer error message here, but the proper place for type checking on that parameter would be in distutils in the stdlib. It would be possible to catch the error at the place where the traceback occurred in egg_info, but that would be inappropriate, as egg_info is only following the assumptions provided by the Distribution class. Thanks for reporting the issue and the follow-up from @didorothy.

@ghost ghost added major bug labels Mar 29, 2016
@ghost ghost closed this as completed Mar 29, 2016
jaraco added a commit that referenced this issue Aug 10, 2022
Ensure Windows SDK directories are not cleared when caller specifies include/library dirs
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants