Python-daemon installation fails with --prefix

if i execute:

pip install --install-option="--prefix=/root/folder" airflow==1.8.0

      

it will end like this

    '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/lib64/python2.7/posixpath.py", line 129, in dirname
    i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'

      

If I do

 pip install airflow==1.8.0

      

it will terminate the process without error.

# pip freeze 
airflow==1.8.0
alembic==0.8.10
backports.ssl-match-hostname==3.4.0.2
chardet==2.2.1
click==6.7
croniter==0.3.16
dill==0.2.6
docutils==0.13.1
Flask==0.11.1
Flask-Admin==1.4.1
Flask-Cache==0.13.1
Flask-Login==0.2.11
flask-swagger==0.2.13
Flask-WTF==0.12
funcsigs==1.0.0
future==0.15.2
gitdb2==2.0.0
GitPython==2.1.3
gunicorn==19.3.0
iniparse==0.4
itsdangerous==0.24
Jinja2==2.8.1
kitchen==1.1.1
lockfile==0.12.2
lxml==3.7.3
Mako==1.0.6
Markdown==2.6.8
MarkupSafe==1.0
numpy==1.12.1
ordereddict==1.1
pandas==0.19.2
psutil==4.4.2
pycurl==7.19.0
Pygments==2.2.0
pygobject==3.14.0
pygpgme==0.3
pyliblzma==0.5.3
python-daemon==2.1.2
python-dateutil==2.6.0
python-editor==1.0.3
python-nvd3==0.14.2
python-slugify==1.1.4
pytz==2017.2
pyxattr==0.5.1
PyYAML==3.12
requests==2.13.0
setproctitle==1.1.10
six==1.10.0
smmap2==2.0.1
SQLAlchemy==1.1.8
tabulate==0.7.7
thrift==0.9.3
Unidecode==0.4.20
urlgrabber==3.10
Werkzeug==0.12.1
WTForms==2.1
yum-metadata-parser==1.1.4
zope.deprecation==4.2.0

      

Since this should work in the jenkins build process, I cannot omit the install parameter. Can any python-power user help me figure out where to see it and how to fix it?

I read that you need to install this library (python-daemon) before anything else, but still doesn't work using the install options:

pip install --install-option="--prefix=/root/folder" python-daemon 

/usr/lib/python2.7/site-packages/pip/commands/install.py:188: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
      File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 230, 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/lib64/python2.7/posixpath.py", line 129, in dirname
        i = p.rfind('/') + 1
    AttributeError: 'NoneType' object has no attribute 'rfind'

      

early.

+3


source to share


2 answers


python-daemon requires docutils.

pip install docutils

      



After that run

pip install python-daemon

      

+4


source


I found a way to make it work, not the best, not the final solution, but it works:

 pip install python-daemon 

      

when it finishes you can see it in the list

[root@localhost ozw1z5rd]# pip freeze | grep daemon 
python-daemon==2.1.2 

      

now remove it

 pip uninstall python-daemon 

      

and of course it will no longer be available on the list

[root@localhost ozw1z5rd]# pip freeze | grep daemon 

      



now set again with prefix

 pip install --install-option="--prefix=/root/folder" python-daemon 

      

this installation is of course not available in pip's block list, but completes without error and inside the new path where the library exists.

[root@localhost ozw1z5rd]# ls /root/folder/lib/python2.7/site-packages/
daemon/                             python_daemon-2.1.2-py2.7.egg-info/ 

      

All of this allowed me to set up the airflow using Jenkins.

I also researched the setup.py script python-daemon, attrs ['script_name'] loaded correctly at the beginning of the code, but it gets lost later.

enter image description here

This screen shows the code where attrs ['script_name'] is lost.

0


source







All Articles