Closed msrajesh closed 5 years ago
Same here....
(netboxenv)root@netbox:/opt/netbox# pip install textfsm
Collecting textfsm
Using cached https://files.pythonhosted.org/packages/a1/0d/a1b490503545b3b4600b965eae5d44cc2b6ce27cfb44f4debc563dbb56d3/textfsm-0.4.1.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/textfsm.egg-info
writing top-level names to pip-egg-info/textfsm.egg-info/top_level.txt
writing dependency_links to pip-egg-info/textfsm.egg-info/dependency_links.txt
writing pip-egg-info/textfsm.egg-info/PKG-INFO
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
Traceback (most recent call last):
File "
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-i3s0hljb/textfsm/
I need to reproduce this first, but the long description is actually the content of the README file, I think the open
function from codecs
does not convert it to a string if no encoding is provided in that Python version.
in setup.py
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md')) as f:
long_description = f.read()
Try to reproduce the error without pip
by cloning the repository and running python setup.py install
. Try forcing the encoding to utf8
in the open
function.
with open(path.join(here, 'README.md'), encoding="utf8") as f:
switch_management]$pip install textfsm
Collecting textfsm Downloading https://files.pythonhosted.org/packages/a1/0d/a1b490503545b3b4600b965eae5d44cc2b6ce27cfb44f4debc563dbb56d3/textfsm-0.4.1.tar.gz Complete output from command python setup.py egg_info: running egg_info creating pip-egg-info/textfsm.egg-info writing top-level names to pip-egg-info/textfsm.egg-info/top_level.txt writing dependency_links to pip-egg-info/textfsm.egg-info/dependency_links.txt writing pip-egg-info/textfsm.egg-info/PKG-INFO /auto/pysw/cel63/python/3.4.1/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'long_description_content_type' warnings.warn(msg) Traceback (most recent call last): File "", line 1, in
File "/tmp/pip-build-ln4qucwi/textfsm/setup.py", line 50, in
'texttable', 'terminal'])
File "/auto/pysw/cel63/python/3.4.1/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/auto/pysw/cel63/python/3.4.1/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/auto/pysw/cel63/python/3.4.1/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/nobackup/rmullang/pyats-raj/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 188, in run
writer(self, ep.name, os.path.join(self.egg_info, ep.name))
File "/nobackup/rmullang/pyats-raj/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 403, in write_pkg_info
metadata.write_pkg_info(cmd.egg_info)
File "/auto/pysw/cel63/python/3.4.1/lib/python3.4/distutils/dist.py", line 1108, in write_pkg_info
self.write_pkg_file(pkg_info)
File "/nobackup/rmullang/pyats-raj/lib/python3.4/site-packages/setuptools/dist.py", line 70, in write_pkg_file
long_desc = rfc822_escape(self.get_long_description())
File "/auto/pysw/cel63/python/3.4.1/lib/python3.4/distutils/util.py", line 470, in rfc822_escape
lines = header.split('\n')
TypeError: Type str doesn't support the buffer API
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ln4qucwi/textfsm/
Python version in the linux server.
Python 3.4.1 (default, Nov 12 2014, 13:34:48) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux Type "help", "copyright", "credits" or "license" for more information.