简体   繁体   中英

python2.7 install python daemon package using pip

When I try to install python daemon package I get this error all the time (installation tried by using pip command & downloading the archive and using pip to install):

pip install python-daemon-2.1.2.tar.gz

Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/7p/x12ctdl94d59qnm_chhj2y240000gn/T/pip-2bGssA-build/setup.py", line 86, in <module>
        "Topic :: Software Development :: Libraries :: Python Modules",
      File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "version.py", line 640, in __init__
        super(ChangelogAwareDistribution, self).__init__(*args, **kwargs)
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 317, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 372, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 851, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1123, in best_match
        return self.obtain(req, installer)
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1135, in obtain
        return installer(requirement)
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 438, in fetch_build_egg
        cmd.ensure_finalized()
      File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
        self.finalize_options()
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 251, in finalize_options
        'dist_version': self.distribution.get_version(),
      File "version.py", line 656, in get_version
        version_info = self.get_version_info()
      File "version.py", line 651, in get_version_info
        changelog_path = get_changelog_path(self)
      File "version.py", line 552, in get_changelog_path
        setup_dirname = os.path.dirname(distribution.script_name)
      File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 122, in dirname
        i = p.rfind('/') + 1
    AttributeError: 'NoneType' object has no attribute 'rfind'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/7p/x12ctdl94d59qnm_chhj2y240000gn/T/pip-2bGssA-build/

I'm new to python, searching for the error code and using the steps provided by other threads doesn't solved the problem.

Just write pip install python-daemon==2.1.2

No need to download python-daemon-2.1.2.tar.gz file while installing from PyPI using pip.

If you want to install using downloaded package follow these steps

  1. tar xvf python-daemon-2.1.2.tar.gz
  2. cd python-daemon-2.1.2
  3. python setup.py install

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