Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vinz243 opened this issue Nov 6, 2014 · 5 comments

Comments

@vinz243
Copy link

vinz243 commented Nov 6, 2014

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
Copy link
Member

mic-e commented Nov 6, 2014

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
Copy link
Author

vinz243 commented Nov 6, 2014

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
Copy link
Member

mic-e commented Nov 6, 2014

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.

@mic-e mic-e changed the title AttributeError: 'module' object has no attribute 'which' AttributeError: 'module' object has no attribute 'which' (python3 is too old) Nov 6, 2014
@franciscod
Copy link
Contributor

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

@mic-e mic-e closed this as completed in 2036cbb Nov 6, 2014
@franciscod
Copy link
Contributor

nice :D

schets added a commit to schets/openage that referenced this issue Nov 12, 2014
earlier, the script would simply fail with an error such as
"no member 'which' in 'shutil'. Now it prints a message stating the
precise version requirement, and exits.

fixes SFTtech#131
inakoll added a commit to inakoll/openage that referenced this issue Nov 24, 2014
earlier, the script would simply fail with an error such as
"no member 'which' in 'shutil'. Now it prints a message stating the
precise version requirement, and exits.

fixes SFTtech#131
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants