pip returns error when installing

Bug #1774134 reported by Ken'ichi Ogawa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
py3dns
Invalid
Undecided
Unassigned

Bug Description

I faced this error when installing py3dns by pip3.6

# Conclusion

I see the source code [DNS/Base.py](https://github.com/ados1991/py3dns/blob/master/DNS/Base.py#L9), I think you need to add `# -*- coding: utf-8 -*-` at top of the file because you use non-ascii character at line 9 `©`.
ref: https://stackoverflow.com/questions/18078851/syntaxerror-of-non-ascii-character

Please check and fix if it is true.

# Log

[ec2-user@blah ~]$ sudo -H pip install py3dns
Collecting py3dns
  Using cached https://files.pythonhosted.org/packages/87/0d/35d3d710ec6ca04d5e5f8b344c6604fc9590629918346801cc5e7425cc4a/py3dns-3.1.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-rVU2G_/py3dns/setup.py", line 7, in <module>
        import DNS
      File "/tmp/pip-build-rVU2G_/py3dns/DNS/__init__.py", line 27, in <module>
        from .Base import DnsRequest
      File "/tmp/pip-build-rVU2G_/py3dns/DNS/Base.py", line 9
    SyntaxError: Non-ASCII character '\xc2' in file /tmp/pip-build-rVU2G_/py3dns/DNS/Base.py on line 10, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-rVU2G_/py3dns/

# Environment

Server: Amazon Linux 2018.03
Python: 3.6
Py3DNS: 3.1.0

Revision history for this message
Scott Kitterman (kitterman) wrote :

I am unable to reproduce this. For python3, UTF-8 is the default, so non-ascii coding does not need to be declared. Are you sure you were using a python3 version of pip?

# pip3 install py3dns
Collecting py3dns
  Using cached https://files.pythonhosted.org/packages/87/0d/35d3d710ec6ca04d5e5f8b344c6604fc9590629918346801cc5e7425cc4a/py3dns-3.1.0.tar.gz
Building wheels for collected packages: py3dns
  Running setup.py bdist_wheel for py3dns ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-er3m_6cv/py3dns/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmphz3a_d65pip-wheel- --python-tag cp36:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help

  error: invalid command 'bdist_wheel'

  ----------------------------------------
  Failed building wheel for py3dns
  Running setup.py clean for py3dns
Failed to build py3dns
Installing collected packages: py3dns
  Running setup.py install for py3dns ... done
Successfully installed py3dns-3.1.0
root@kitterma-E6430:/home# python3
Python 3.6.6 (default, Jun 27 2018, 14:44:17)
[GCC 8.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import DNS
>>>

Note that the bdist_wheel error doesn't actually stop it from working. As far as I can tell, this works fine.

Changed in py3dns:
status: New → Incomplete
Revision history for this message
Scott Kitterman (kitterman) wrote :

I've confirmed that's not needed for Python3, so it's almost certain setup.py was run with python2 or with a non-standard python3 configuration. Closing as invalid since you can't install python3 modules with python2 and without a method to reproduce, there's nothing to be done.

Changed in py3dns:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.