This repository has been archived by the owner. It is now read-only.

yum become unavailable if I set LD_LIBRARY_PATH=pitchfork/deployment/lib #390

Closed
TakashiKoyama opened this Issue Apr 28, 2017 · 9 comments

Comments

Projects
None yet
3 participants
@TakashiKoyama

TakashiKoyama commented Apr 28, 2017

Hi,

I'm using CentOS7.
I set

export LD_LIBRARY_PATH=/path/to/pitchfork/deployment/lib:$LD_LIBRARY_PATH

in /etc/profile to make pitchfork libraries be available .

However if I do so, yum become unavailable with saying that

# yum --help
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.10 (default, Apr  7 2017, 00:55:54) 
[GCC 5.3.1 20160406 (Red Hat 5.3.1-6)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

How can I solve this problem?
Thank you for your kind helps!

Takashi

@mhsieh

This comment has been minimized.

Show comment
Hide comment
@mhsieh

mhsieh Apr 28, 2017

Member

Hello Takashi,
You might not want to use pitchfork environment all the time, it's not recommended to write that setting to your ~/.bashrc or ~/.bash_profile or ~/.profile files. But if you really want to use yum under pitchfork environment, I will need to investigate a little bit and go back to you.

Member

mhsieh commented Apr 28, 2017

Hello Takashi,
You might not want to use pitchfork environment all the time, it's not recommended to write that setting to your ~/.bashrc or ~/.bash_profile or ~/.profile files. But if you really want to use yum under pitchfork environment, I will need to investigate a little bit and go back to you.

@mhsieh

This comment has been minimized.

Show comment
Hide comment
@mhsieh

mhsieh Apr 28, 2017

Member

Dear Takashi,
Can you check your yum really quick for me? Can you post the output of this command for us?

head $(which yum)
Member

mhsieh commented Apr 28, 2017

Dear Takashi,
Can you check your yum really quick for me? Can you post the output of this command for us?

head $(which yum)
@TakashiKoyama

This comment has been minimized.

Show comment
Hide comment
@TakashiKoyama

TakashiKoyama Apr 29, 2017

Dear mhsieh

Thank you for your comments!
Here is the output.

$ head $(which yum)
#!/usr/bin/python
import sys
try:
    import yum
except ImportError:
    print >> sys.stderr, """\
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   %s

Takashi

TakashiKoyama commented Apr 29, 2017

Dear mhsieh

Thank you for your comments!
Here is the output.

$ head $(which yum)
#!/usr/bin/python
import sys
try:
    import yum
except ImportError:
    print >> sys.stderr, """\
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   %s

Takashi

@mjhsieh

This comment has been minimized.

Show comment
Hide comment
@mjhsieh

mjhsieh Apr 29, 2017

Contributor

That's very interesting, I am not sure how it could be the case of pitchfork could possibly interfere with your system yum. Can you try env -u LD_LIBRARY_PATH yum --help? Let's see if your system yum still has similar error without LD_LIBRARY_PATH.

Contributor

mjhsieh commented Apr 29, 2017

That's very interesting, I am not sure how it could be the case of pitchfork could possibly interfere with your system yum. Can you try env -u LD_LIBRARY_PATH yum --help? Let's see if your system yum still has similar error without LD_LIBRARY_PATH.

@TakashiKoyama

This comment has been minimized.

Show comment
Hide comment
@TakashiKoyama

TakashiKoyama Apr 29, 2017

Hi,

yum works withenv -u LD_LIBRARY_PATH yum --help and so yum works without LD_LIBRARY_PATH.

I think the cause of this phenomena might be from change of sys.path in python environment as shown below.

# env -u LD_LIBRARY_PATH python
Python 2.7.5 (default, Nov  6 2016, 00:28:07) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages']
>>> quit()
# python
Python 2.7.10 (default, Apr  7 2017, 00:55:54) 
[GCC 5.3.1 20160406 (Red Hat 5.3.1-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python27.zip', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7/plat-linux2', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7/lib-tk', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7/lib-old', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7/lib-dynload', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7/site-packages']
>>> quit()

As you can see, version of python and sys.path is changed between with and without LD_LIBRARY_PATH.

Takashi

TakashiKoyama commented Apr 29, 2017

Hi,

yum works withenv -u LD_LIBRARY_PATH yum --help and so yum works without LD_LIBRARY_PATH.

I think the cause of this phenomena might be from change of sys.path in python environment as shown below.

# env -u LD_LIBRARY_PATH python
Python 2.7.5 (default, Nov  6 2016, 00:28:07) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages']
>>> quit()
# python
Python 2.7.10 (default, Apr  7 2017, 00:55:54) 
[GCC 5.3.1 20160406 (Red Hat 5.3.1-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python27.zip', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7/plat-linux2', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7/lib-tk', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7/lib-old', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7/lib-dynload', '/home/samba/Suijitsu_Public/software/pitchfork/deployment/lib/python2.7/site-packages']
>>> quit()

As you can see, version of python and sys.path is changed between with and without LD_LIBRARY_PATH.

Takashi

@mhsieh

This comment has been minimized.

Show comment
Hide comment
@mhsieh

mhsieh May 1, 2017

Member

I see. I would recommend removal of any reference pitchfork in /etc/profile if it's possible for you. The libpython*.so is what causes the problem. Some suggestion will follow after I finish my day job work.

Member

mhsieh commented May 1, 2017

I see. I would recommend removal of any reference pitchfork in /etc/profile if it's possible for you. The libpython*.so is what causes the problem. Some suggestion will follow after I finish my day job work.

@mhsieh

This comment has been minimized.

Show comment
Hide comment
@mhsieh

mhsieh May 2, 2017

Member

Sorry I was spent last night, here are my suggestions for the solution:

  1. First solution would be rethinking your strategy and avoid putting pitchfork setting in your /etc/profile or user profile, instead of that you can design a wrapper as an entry point of your commands. For example a command wrapper call mypb:
#!/bin/bash
source /home/samba/Suijitsu_Public/software/pitchfork/deployment/setup-env.sh
$@

add this mypb to your PATH, suppose you put it in your $HOME/bin/mypb and your $PATH includes $HOME/bin, then you should be able to do this easily:

$ mypb blasr --version
blasr   5.3.da161e5
  1. Second solution would still be removing pitchfork settings from your /etc/profile and user's profile, to use bash --init-file /home/samba/Suijitsu_Public/software/pitchfork/deployment/setup-env.sh (I call this "pitchfork shell") when you want to use pitchfork build just like what we wrote in the documentation. But this time I recommend you to rebuild your pitchfork with this:
cd ~/pitchfork
yes | make _startover
echo HAVE_PYTHON=/usr/bin/python >> settings.mk
make <your software>

so you can still run yum under "pitchfork shell".

Of course you can do both suggestions at the same time.

Member

mhsieh commented May 2, 2017

Sorry I was spent last night, here are my suggestions for the solution:

  1. First solution would be rethinking your strategy and avoid putting pitchfork setting in your /etc/profile or user profile, instead of that you can design a wrapper as an entry point of your commands. For example a command wrapper call mypb:
#!/bin/bash
source /home/samba/Suijitsu_Public/software/pitchfork/deployment/setup-env.sh
$@

add this mypb to your PATH, suppose you put it in your $HOME/bin/mypb and your $PATH includes $HOME/bin, then you should be able to do this easily:

$ mypb blasr --version
blasr   5.3.da161e5
  1. Second solution would still be removing pitchfork settings from your /etc/profile and user's profile, to use bash --init-file /home/samba/Suijitsu_Public/software/pitchfork/deployment/setup-env.sh (I call this "pitchfork shell") when you want to use pitchfork build just like what we wrote in the documentation. But this time I recommend you to rebuild your pitchfork with this:
cd ~/pitchfork
yes | make _startover
echo HAVE_PYTHON=/usr/bin/python >> settings.mk
make <your software>

so you can still run yum under "pitchfork shell".

Of course you can do both suggestions at the same time.

@TakashiKoyama

This comment has been minimized.

Show comment
Hide comment
@TakashiKoyama

TakashiKoyama May 8, 2017

Hi,

Sorry for late reply.
Thank you so much for the solutions.
Both of them works fine!

Takashi

TakashiKoyama commented May 8, 2017

Hi,

Sorry for late reply.
Thank you so much for the solutions.
Both of them works fine!

Takashi

@mhsieh

This comment has been minimized.

Show comment
Hide comment
@mhsieh

mhsieh Jan 27, 2018

Member

cleaning up old issues, if yo'all find issue I haven't solved, feel free to re-open it, thanks!

Member

mhsieh commented Jan 27, 2018

cleaning up old issues, if yo'all find issue I haven't solved, feel free to re-open it, thanks!

@mhsieh mhsieh closed this Jan 27, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.