ericmandel / pyds9

Python connection to SAOimage DS9 via XPA
76 stars 41 forks source link

Pyds9 not compatible with python 3.8 #98

Closed janerigby closed 1 year ago

janerigby commented 3 years ago

I'm trying to use pyds9 but am stymied because it won't install for python=3.8.

ericmandel commented 3 years ago

@janerigby I am sorry to say that we no longer have a Python expert working on pyds9 to handle questions of this sort. I have alerted the DS9 team about this, but I don't believe they are prepared to put any effort into pyds9 at this point.

StarkillerX42 commented 3 years ago

I'm interested in helping, although I have limited experience in shared projects like this. I have been able to install pyds9 via pip as well as straight from setuptools using GitHub's master branch on python 3.8. How are you trying to install it?

janerigby commented 3 years ago

I was trying to install pyds9 using conda, in an environment that I had built to use python=3.8 and astropy. To get pyds9 to install, I had to nuke that conda environment, make a new one with python=3.7, install astropy, and then install pyds9.

janerigby commented 3 years ago

Here's the conda error:

conda install pyds9
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \ 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                         

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - pyds9 -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0|3.4.*']

Your python: python=3.8

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
StarkillerX42 commented 3 years ago

Have you tried pip install pyds9?

schen70 commented 2 years ago

I tried pip install pyds9 on python=3.8, and it ran into this error:

`pip install pyds9 Collecting pyds9 Using cached pyds9-1.8.1.tar.gz (888 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: six in ./anaconda3/envs/ciao-4.14/lib/python3.8/site-packages (from pyds9) (1.16.0) Building wheels for collected packages: pyds9 Building wheel for pyds9 (setup.py) ... error ERROR: Command errored out with exit status 1: command: /home/steven/anaconda3/envs/ciao-4.14/bin/python3.8 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-slysfi9z/pyds9_b2ac5aef66594a37a5a0bdd02aba820f/setup.py'"'"'; file='"'"'/tmp/pip-install-slysfi9z/pyds9_b2ac5aef66594a37a5a0bdd02aba820f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-pznsgn2y cwd: /tmp/pip-install-slysfi9z/pyds9_b2ac5aef66594a37a5a0bdd02aba820f/ Complete output (98 lines): /home/steven/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running bdist_wheel running build running build_py building XPA shared library ... checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking size of long... 8 checking for ranlib... ranlib checking for ANSI C header files... (cached) yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking values.h usability... yes checking values.h presence... yes checking for values.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking setjmp.h usability... yes checking setjmp.h presence... yes checking for setjmp.h... yes checking sys/un.h usability... yes checking sys/un.h presence... yes checking for sys/un.h... yes checking sys/shm.h usability... yes checking sys/shm.h presence... yes checking for sys/shm.h... yes checking sys/mman.h usability... yes checking sys/mman.h presence... yes checking for sys/mman.h... yes checking sys/ipc.h usability... yes checking sys/ipc.h presence... yes checking for sys/ipc.h... yes checking for socklen_t... yes checking for an ANSI C-conforming const... yes checking for strchr... yes checking for memcpy... yes checking for snprintf... yes checking for atexit... yes checking for setenv... yes checking for connect... yes checking for gethostbyname... yes checking for threaded xpans... no checking for shared library build... yes checking for request to use posix_spawn... no checking for X... no checking for Tcl configuration... skipping Tcl configuration checking for incorporation of thread support... no checking for gtk... no checking linux-gnu configuration... adding -fPIC to gcc configure: creating ./config.status config.status: creating Makefile config.status: creating conf.h sh: 1: make: not found sh: 1: make: not found creating build creating build/lib copying pyds9.py -> build/lib copying xpa.py -> build/lib /home/steven/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running install running install_lib creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/wheel running install_data Installing data files to build/bdist.linux-x86_64/wheel/ error: can't copy 'xpa/libxpa.so': doesn't exist or not a regular file ---------------------------------------- ERROR: Failed building wheel for pyds9 Running setup.py clean for pyds9 Failed to build pyds9 Installing collected packages: pyds9 Running setup.py install for pyds9 ... error ERROR: Command errored out with exit status 1: command: /home/steven/anaconda3/envs/ciao-4.14/bin/python3.8 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-slysfi9z/pyds9_b2ac5aef66594a37a5a0bdd02aba820f/setup.py'"'"'; file='"'"'/tmp/pip-install-slysfi9z/pyds9_b2ac5aef66594a37a5a0bdd02aba820f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-3x5rj4de/install-record.txt --single-version-externally-managed --compile --install-headers /home/steven/anaconda3/envs/ciao-4.14/include/python3.8/pyds9 cwd: /tmp/pip-install-slysfi9z/pyds9_b2ac5aef66594a37a5a0bdd02aba820f/ Complete output (96 lines): /home/steven/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install /home/steven/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py building XPA shared library ... checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking size of long... 8 checking for ranlib... ranlib checking for ANSI C header files... (cached) yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking values.h usability... yes checking values.h presence... yes checking for values.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking setjmp.h usability... yes checking setjmp.h presence... yes checking for setjmp.h... yes checking sys/un.h usability... yes checking sys/un.h presence... yes checking for sys/un.h... yes checking sys/shm.h usability... yes checking sys/shm.h presence... yes checking for sys/shm.h... yes checking sys/mman.h usability... yes checking sys/mman.h presence... yes checking for sys/mman.h... yes checking sys/ipc.h usability... yes checking sys/ipc.h presence... yes checking for sys/ipc.h... yes checking for socklen_t... yes checking for an ANSI C-conforming const... yes checking for strchr... yes checking for memcpy... yes checking for snprintf... yes checking for atexit... yes checking for setenv... yes checking for connect... yes checking for gethostbyname... yes checking for threaded xpans... no checking for shared library build... yes checking for request to use posix_spawn... no checking for X... no checking for Tcl configuration... skipping Tcl configuration checking for incorporation of thread support... no checking for gtk... no checking linux-gnu configuration... adding -fPIC to gcc configure: creating ./config.status config.status: creating Makefile config.status: creating conf.h config.status: conf.h is unchanged sh: 1: make: not found sh: 1: make: not found creating build creating build/lib copying pyds9.py -> build/lib copying xpa.py -> build/lib running install_lib running install_data Installing data files to /home/steven/anaconda3/envs/ciao-4.14/lib/python3.8/site-packages/ error: can't copy 'xpa/libxpa.so': doesn't exist or not a regular file ---------------------------------------- ERROR: Command errored out with exit status 1: /home/steven/anaconda3/envs/ciao-4.14/bin/python3.8 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-slysfi9z/pyds9_b2ac5aef66594a37a5a0bdd02aba820f/setup.py'"'"'; file='"'"'/tmp/pip-install-slysfi9z/pyds9_b2ac5aef66594a37a5a0bdd02aba820f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-3x5rj4de/install-record.txt --single-version-externally-managed --compile --install-headers /home/steven/anaconda3/envs/ciao-4.14/include/python3.8/pyds9 Check the logs for full command output. `

ericmandel commented 2 years ago

I am sorry to say that we no longer have a Python expert working on pyds9 to handle questions of this sort.

jbrinchmann commented 1 year ago

It runs for me under python 3.10 off git with a few minor fixes to setup.py as described in issue #107. For reference, what i did was:

> conda create -n pyds9 jupyter astropy numpy scipy pytest pytest-astropy pip
> conda activate pyds9
> git clone https://github.com/ericmandel/pyds9.git  # I used my own fork but that is not crucial.
> cd pyds9
 ... Make changes to setup.py as per #107 ...
> pip install -e .   # To allow editing in case something comes up
> python
....
>>> import pyds9
>>> d = pyds9.DS9()

At least the basic playing around I tried works fine - the test command does not work for me though (to run them you need to modify setup_package.py to use astropy_helpers.astropy_helpers rather than astropy_helpers but even so it hangs on my machine but I could not be bothered to look more into it.

ericmandel commented 1 year ago

As of 1 July 2022, I am no longer involved with software in any way, and all packages in my GitHub repository are unsupported. Your best bet is to fork this repository and make the changes you want.