ratt-ru / radiopadre

(Radio) Python Astronomy Data Reductions Examiner
MIT License
10 stars 0 forks source link

python3.8 install weirdness #109

Closed SpheMakh closed 3 years ago

SpheMakh commented 3 years ago

It looks like the destination folder does not exist

    setup-radiopadre-virtualenv: copying /home/sphemakh/work/projects/meerkat-GPS/venv/lib/python3.6/site-packages/notebook/static/radiopadre-www to /tmp/pip-req-build-pwzvjxrj/radiopadre/html
    Traceback (most recent call last):
      File "./bin/setup-radiopadre-virtualenv", line 156, in <module>
        shutil.copy2(f"{PADRE_PATH}/icons/radiopadre-logo.ico", f"{notebook_static}/base/images/favicon-notebook.ico")
      File "/usr/lib/python3.8/shutil.py", line 432, in copy2
        copyfile(src, dst, follow_symlinks=follow_symlinks)
      File "/usr/lib/python3.8/shutil.py", line 261, in copyfile
        with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
    FileNotFoundError: [Errno 2] No such file or directory: '/home/sphemakh/work/projects/meerkat-GPS/venv/lib/python3.6/site-packages/notebook/static/base/images/favicon-notebook.ico'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-pwzvjxrj/setup.py", line 48, in <module>
        setup(
      File "/home/sphemakh/work/projects/meerkat-GPS/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/pip-req-build-pwzvjxrj/setup.py", line 32, in run
        subprocess.check_call(command)
      File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['./bin/setup-radiopadre-virtualenv']' returned non-zero exit status 1.
    ----------------------------------------
o-smirnov commented 3 years ago

Jupyter must have changed some path structures. Could you please try find /home/sphemakh/work/projects/meerkat-GPS/venv/lib/python3.6/site-packages/notebook -name favicon-notebook.ico and tell me what it reports?

BTW, your venv path mentions python 3.6, and everything else is python 3.8. Can this be right?

SpheMakh commented 3 years ago

BTW, your venv path mentions python 3.6, and everything else is python 3.8. Can this be right?

The python3 on this machine is 3.6, I should ask the admin to upgrade it.

SpheMakh commented 3 years ago

The python3 on this machine is 3.6, I should ask the admin to upgrade it.

Wait, this is on my laptop. I'm the admin!

But yes, this may be the issue. I could find the favicon-notebook.ico in the 3.8 path but in not the 3.6 one. As to how the python 3.6 branch exists, I have no idea

o-smirnov commented 3 years ago

Or maybe you did upgrade to 3.8, but now you're reinstalling radiopadre into a stale 3.6 environment?

Try running it with --venv-reinstall to blow everything away and rebuild. Be prepared to swear at pyregions when you do.

SpheMakh commented 3 years ago

I nuked the venv, and started another one. It looks like something in the install adds python3.6 (I do have both versions)

Before

(venv) sphemakh@makeba:~/work/projects/meerkat-GPS$ ls -lrt venv/lib
total 4
drwxrwxr-x 3 sphemakh sphemakh 4096 Mar 29 12:23 python3.8

After

(venv) sphemakh@makeba:~/work/projects/meerkat-GPS$ ls -lrt venv/lib
total 8
drwxrwxr-x 3 sphemakh sphemakh 4096 Mar 29 12:29 python3.8
drwxrwxr-x 3 sphemakh sphemakh 4096 Mar 29 12:32 python3.6
o-smirnov commented 3 years ago

So what exactly are your installation steps? You create a new 3.8 environment, and then?...

SpheMakh commented 3 years ago
python -m venv venv
(venv) sphemakh@makeba:~/work/projects/meerkat-GPS$ python --version
Python 3.8.5
pip install -U pip wheel
pip install radiopadre 
o-smirnov commented 3 years ago

Ah. Try pip install radiopadre-client, that's the intended way of setting it up. The client will then take care of installing the main package wherever.

(That said, the main package shouldn't be breaking the venv like that, so I'll leave the bug open.)

o-smirnov commented 3 years ago

Ahh I see the problem. A quick and very dirty hack that should never have made it into production: https://github.com/ratt-ru/radiopadre/blob/master/bin/setup-radiopadre-virtualenv#L115

This is why we need code reviews!

SpheMakh commented 3 years ago

shocked

o-smirnov commented 3 years ago

I challenge anyone to look me in the eye and tell me they haven't done worse!

o-smirnov commented 3 years ago

1.1.2 is on PyPI -- can you check that it fixes this?