SFTtech / openage

Free (as in freedom) open source clone of the Age of Empires II engine 🚀
http://openage.dev
Other
12.63k stars 1.11k forks source link

AttributeError: 'module' object has no attribute 'which' (python3 is too old) #131

Closed vinz243 closed 9 years ago

vinz243 commented 9 years ago

I have python3 installed. I tried to install ALL deps but unfortunately a few couldn't be found. So I installed the others and the one not found I could install them on Synaptic.

~/Documents/openage$ ./configure --mode=debug --compiler=llvm
./configure is a convenience script that creates the build directory and invokes cmake for an out-of-source build.

don't feel obliged to use this, especially if you're packaging openage.

Traceback (most recent call last):
  File "./configure", line 189, in <module>
    if not shutil.which(cc):
AttributeError: 'module' object has no attribute 'which'
mic-e commented 9 years ago

which was added to shutil in Python version 3.3. I assume your python version is 3.2.

If you're running debian stable, that's sort of an issue. Last time I tried to port a small-ish script that was written with python3.3 in mind to python3.2, I gave up after about half an hour. openage contains a substantial collection of code that was written with python3.4 in mind, but tested on python3.3.

vinz243 commented 9 years ago

Thank you for your quick anwser. how do I update it? I tried

    wget https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tar.xz
    tar -Jxf Python-3.4.1.tar.xz 
    cd Python-3.4.1
    ./configure --prefix=/opt/python3.4.1
    make -j 4
    sudo make install

But when I run:

~ /Documents/Python-3.4.1$ python3
Python 3.2.3 (default, Feb 27 2014, 21:31:18) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
mic-e commented 9 years ago

Your distro doesn't know about software that's installed in /opt...

You have to add the bin folder in /opt/python3.4.1 to the beginning of your PATH environment variable, but that will probably not be enough.

Have a look at #16 where OSX users pass the path of a manually installed version of python3 to ./configure. You'll also need to add the bin directory in /opt/python3.4.1 to the beginning of your PATH environment variable.

And finally you'll probably have to run configure not as ./configure, but as python3 configure.

franciscod commented 9 years ago

however, our scripts should detect this issue and alert the user that they must upgrade python in order to continue!

franciscod commented 9 years ago

nice :D