bulik / ldsc

LD Score Regression (LDSC)
GNU General Public License v3.0
601 stars 331 forks source link

Can't run ldsc under screen at Linux #417

Open eightYao2 opened 3 months ago

eightYao2 commented 3 months ago

When I runned ./ldsc.py -h under screen mood, it reported as:

File "/home/work/ldsc/./ldsc.py", line 84
    print msg
    ^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

But if I'm not under screen at bash,it's work successfully,I have a big job need to run under screen, and I'm sured I use python 2.7 enviroment, but still the same question. Is there any hints on this issue?

please help me, thanks!

garciamarinlm commented 3 months ago

I have the same issue. My advice is to modify the source code to change:

print msg

to

print(msg)

sof202 commented 1 month ago

This was happening with my system a few weeks ago as well. The reason was that I was unknowingly running the file with the wrong python version. Although I was running the program under the ldsc conda environment, python2 was not at the top of the PATH (due to my regular python installation on version 3.10.4 being prioritised). Be sure to double check that python 2.7 is indeed the executable being used to run ldsc.py (with python --version etc.).

Also: I'm not sold on changing print msg to print(msg) as it is avoiding the problem that you are likely using the wrong version of python. The error message you are getting should not appear when running the ldsc.py file with python version 2. Changing all of these print messages will probably be a hassle and might not even work in the end.