wieluk / psychopy_linux_installer

Installing PsychoPy on Linux can be challenging, so I've created an installer to make the process easier and more streamlined.
GNU General Public License v3.0
5 stars 1 forks source link

sudo_wrapper not catching error codes in other languages than english #33

Closed kjoscha closed 6 days ago

kjoscha commented 1 week ago

If I install on Ubunut 24.04 with preinstalled python 3.12 via

./psychopy_linux_installer --psychopy-version=2024.1.4 --build=python --verbose

I get the following error message, although python3.10 seems to be installed:

2024-10-30 12:29:50 - Info: Python 3.10.15 built and installed into /usr/local/psychopy_python.
2024-10-30 12:29:50 - Error: python3.10 not found in /usr/local/psychopy_python. Something went wrong while installing/building. Try --build=python and --verbose as arguments.
wieluk commented 1 week ago

Does it say anyting else with verbose?

Did you use --build=python because it did not work without?

I will try to replicate.

kjoscha commented 1 week ago

Thank you for the quick reply! Yes, I tried without --build=python before and got the same error: python3.10 not found in /usr/local/psychopy_python

wieluk commented 1 week ago

But is there python3.10 in /usr/local/psychopy_python/bin ? Or does the build/install fail silently? Are you using Version: 1.2.2?

kjoscha commented 1 week ago

Ah yeah, in fact there is no /usr/local/psychopy__python folder, although the log stated that it was installed there

wieluk commented 1 week ago

Yea, sorry I need to improve error catching but that is kinda hard in bash without exiting the script. I will change/remove Info: Python 3.10.15 built and installed into /usr/local/psychopy_python.. What happens with verbose? There is probably a dependency missing to build python.

I just tried on a clean ubuntu 24.04 VM but can not replicate. Did you do a full-upgrade before?

I had a problem once when doing a full upgrade. I will try to replicate with doing a full upgrade before.

kjoscha commented 1 week ago

I tried on a fresh Ubuntu 24.04, too. As far as I can remember, I did no full upgrade before. I let it run via verpose flag. Here is the tail of my log:


ec/mpdecimal.o build/temp.linux-x86_64-3.10/home/selana/psychopy_2024.1.4_py3.10/Python-3.10.15_temp/Python-3.10.15/Modules/_decimal/libmpdec/numbertheory.o build/temp.linux-x86_64-3.10/home/selana/psychopy_2024.1.4_py3.10/Python-3.10.15_temp/Python-3.10.15/Modules/_decimal/libmpdec/sixstep.o build/temp.linux-x86_64-3.10/home/selana/psychopy_2024.1.4_py3.10/Python-3.10.15_temp/Python-3.10.15/Modules/_decimal/libmpdec/transpose.o -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -lm -o build/lib.linux-x86_64-3.10/_decimal.cpython-310-x86_64-linux-gnu.so

The necessary bits to build these optional modules were not found:
_dbm                  _gdbm                 _tkinter           
nis                                                            
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc                  pwd                   time               

running build_scripts
copying and adjusting /home/selana/psychopy_2024.1.4_py3.10/Python-3.10.15_temp/Python-3.10.15/Tools/scripts/pydoc3 -> build/scripts-3.10
copying and adjusting /home/selana/psychopy_2024.1.4_py3.10/Python-3.10.15_temp/Python-3.10.15/Tools/scripts/idle3 -> build/scripts-3.10
copying and adjusting /home/selana/psychopy_2024.1.4_py3.10/Python-3.10.15_temp/Python-3.10.15/Tools/scripts/2to3 -> build/scripts-3.10
changing mode of build/scripts-3.10/pydoc3 from 664 to 775
changing mode of build/scripts-3.10/idle3 from 664 to 775
changing mode of build/scripts-3.10/2to3 from 664 to 775
renaming build/scripts-3.10/pydoc3 to build/scripts-3.10/pydoc3.10
renaming build/scripts-3.10/idle3 to build/scripts-3.10/idle3.10
renaming build/scripts-3.10/2to3 to build/scripts-3.10/2to3-3.10
make[1]: Verzeichnis „/home/selana/psychopy_2024.1.4_py3.10/Python-3.10.15_temp/Python-3.10.15“ wird verlassen
Command 'rm -rf Python-3.10.15_temp Python-3.10.15.tgz' failed due to permission denied. Retry with sudo (r), continue without sudo (c), quit (q), or auto sudo when needed (a)? [r/c/q/a] r
2024-10-30 12:29:50 - Info: Retrying rm -rf Python-3.10.15_temp Python-3.10.15.tgz with sudo ...
2024-10-30 12:29:50 - Info: Python 3.10.15 built and installed into /usr/local/psychopy_python.
2024-10-30 12:29:50 - Error: python3.10 not found in /usr/local/psychopy_python. Something went wrong while installing/building. Try --build=python and --verbose as arguments.
wieluk commented 1 week ago

Could you send the whole output of the script?

You can use: ./psychopy_linux_installer --sudo-mode=auto -v -f > debug.log 2>&1 This will save the output to debug.log.

And then upload the log to https://pastebin.com

kjoscha commented 1 week ago

yeah, of course. By the way, similar error wirhout the build flag:


2024-10-30 13:24:13 - Warning: Python 3.10 not available in apt-get.
2024-10-30 13:24:13 - Info: Installing python build dependencies ...
2024-10-30 13:24:25 - Info: Successfully downloaded Python python-3.10.15-linux_x86_64-ubuntu-24.04.tar.gz ... making an altinstall ...
Command 'rm -rf python-3.10.15-linux_x86_64-ubuntu-24.04_temp python-3.10.15-linux_x86_64-ubuntu-24.04.tar.gz' failed due to permission denied. Retry with sudo (r), continue without sudo (c), quit (q), or auto sudo when needed (a)? [r/c/q/a] r
2024-10-30 13:24:29 - Info: Retrying rm -rf python-3.10.15-linux_x86_64-ubuntu-24.04_temp python-3.10.15-linux_x86_64-ubuntu-24.04.tar.gz with sudo ...
2024-10-30 13:24:29 - Successfully installed Python python-3.10.15-linux_x86_64-ubuntu-24.04.tar.gz into /usr/local/psychopy_python
2024-10-30 13:24:29 - Error: python3.10 not found in /usr/local/psychopy_python. Something went wrong while installing/building. Try --build=python and --verbose as arguments.
kjoscha commented 1 week ago

here without the build flag: https://pastebin.com/y7cRAEPy

wieluk commented 1 week ago

It’s strange – running python altinstall doesn’t produce any output here. However, when I enable verbose mode, it generates a lot of output.

I just tried on a fully upgraded ubuntu 24.04 and can still not reproduce.

I’ve created a branch that might address this problem.

You can try with this branch: git clone -b remove-subshell https://github.com/wieluk/psychopy_linux_installer.git

And upload the output again. I hope there will be some output at least.

kjoscha commented 1 week ago

Unfortunatly no different output I guess: https://pastebin.com/VLxmd3W0

Would it be a workaround trying to downgrade my system python3 from 3.12 to 3.10?

wieluk commented 1 week ago

You can try to install python manually.

sudo apt-get install build-essential libssl-dev zlib1g-dev libsqlite3-dev libffi-dev libbz2-dev libreadline-dev xz-utils make
curl -s -O https://www.python.org/ftp/python/3.10.15/Python-3.10.15.tgz
tar -xf Python-3.10.15.tgz
cd Python-3.10.15
./configure --enable-optimizations --with-ensurepip=install --prefix=/usr/local/psychopy_python
make -j "$(nproc)"
sudo make altinstall

Use one command after the other to check what throws a error if anything does.

If this runs without error you should have python3.10 as altinstall in /usr/local/psychopy_python. If it does not we maybe know the problem.

If you use my script afterwards without the build option and python3.10 is in /usr/local/psychopy_python/bin it should be detected.

kjoscha commented 1 week ago

great, it works! Thank you so much!

wieluk commented 1 week ago

That's good! Unfortunately I can not fix the problem in my script...

Did this sudo apt-get install build-essential libssl-dev zlib1g-dev libsqlite3-dev libffi-dev libbz2-dev libreadline-dev xz-utils make install something or did you already have all packages installed?

kjoscha commented 1 week ago

This was all already installed

wieluk commented 6 days ago

Please reopen if the new release does not fix this for you.