Python-setuptools after python2-bin

I am trying to install python2-setuptools after having installed the newly available AUR package python2-bin. I get the following error:

Could not find platform independent libraries <prefix> 
Could not find platform dependent libraries <exec_prefix> 
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] 
ImportError: No module named site

Any ideas what to do, or what location to set the PYTHONHOME variable to?

if I export PYTHONHOME=/usr/lib/python2.7 , then the python2-setuptools install process will say:

ImportError: No module named site

If I additionaly export PYTHONHOME=/usr/lib/python2.7, I get:

Traceback (most recent call last):
    File "bootstrap.py", line 13, in <module> 
        import subprocess 
    File "/usr/lib/python2.7/subprocess.py", line 72, in <module> 
         import select 
ImportError: No module named select

THANKS!

The PYTHONHOME variable looks correct; not sure why the new package is failing to install. One workaround would be to install python 2.7 via pyenv (https://github.com/pyenv/pyenv). I just tried it and it not only works, but the setuptools module is provided as well.

1 Like

thanks!
So, I:

  1. yay -S pyenv
  2. pyenv install 2.7.18
  3. now how do I install all the python dependencies I need within pyenv?
  • pygtk
  • pip
  • configobj
  • ipython
  • pytx
  • pillow

thanks @ajgringo619 !

After you’ve installed python2 via pyenv, you’ll need to do the following:

# switch to python2
pyenv shell 2.7.18

# upgrade pip
pip install --upgrade pip

These modules will be installed under $HOME/.pyenv/versions/2.7.18. If you wish to create a virtual environment, you’ll also need to install that module:

pip install virtualenv

I’ve tested installing ipython, but I’m not certain that the others will work. You’re working with completely unmaintained software, so proceed with caution.

To return to your normal python/pip, run this:

pyenv shell --unset
1 Like

thanks!
I managed to install everything but pyGTK
but no worries, I’ll just give up and install the windows version through bottles/wine

thanks anyway for your great help!