alan-turing-institute/scivision

[BUG] Can't locally install from git on Windows

evangeline-corcoran opened this issue · 6 comments

Describe the bug

Install of scivision github version fails when trying to install in local conda env on windows laptop. 'pip install scivision' works as expected but doesn't let me access the most recent dev version

How To Reproduce

  1. Activate conda env locally on windows laptop
  2. git clone https://github.com/alan-turing-institute/scivision.git
  3. cd scivision
  4. pip install -v -e .
  5. Receive following error:
Using pip 23.1.2 from C:\Users\ecorcoran\Anaconda3\envs\scivision\lib\site-packages\pip (python 3.9)
Obtaining file:///C:/Users/ecorcoran/scivision
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\ecorcoran\scivision\setup.py", line 7, in <module>
      long_description = (this_directory / "README.md").read_text()
    File "C:\Users\ecorcoran\Anaconda3\envs\scivision\lib\pathlib.py", line 1257, in read_text
      return f.read()
    File "C:\Users\ecorcoran\Anaconda3\envs\scivision\lib\encodings\cp1252.py", line 23, in decode
      return codecs.charmap_decode(input,self.errors,decoding_table)[0]
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 2200: character maps to <undefined>
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\ecorcoran\Anaconda3\envs\scivision\python.exe' -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'C:\\Users\\ecorcoran\\scivision\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base 'C:\Users\ecorcoran\AppData\Local\Temp\pip-pip-egg-info-f8k1cavg'
  cwd: C:\Users\ecorcoran\scivision\
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

OR

  1. activate conda env locally on windows laptop
  2. pip install git+https://github.com/alan-turing-institute/scivision
  3. same error as above is received

Expected behaviour

Version of scivision on main branch + requirements successfully installs into conda env

Environment (generate for Linux, macOS and 64-bit Windows)

Windows conda environment with below configuration:

aiohttp                   3.8.4                    pypi_0    pypi
aiosignal                 1.3.1                    pypi_0    pypi
anyio                     3.7.0                    pypi_0    pypi
appdirs                   1.4.4                    pypi_0    pypi
argon2-cffi               21.3.0                   pypi_0    pypi
argon2-cffi-bindings      21.2.0                   pypi_0    pypi
arrow                     1.2.3                    pypi_0    pypi
asciitree                 0.3.3                    pypi_0    pypi
asttokens                 2.2.1                    pypi_0    pypi
async-timeout             4.0.2                    pypi_0    pypi
attrs                     23.1.0                   pypi_0    pypi
backcall                  0.2.0                    pypi_0    pypi
beautifulsoup4            4.12.2                   pypi_0    pypi
bleach                    6.0.0                    pypi_0    pypi
ca-certificates           2023.05.30           haa95532_0
certifi                   2023.5.7                 pypi_0    pypi
cffi                      1.15.1                   pypi_0    pypi
cftime                    1.6.2                    pypi_0    pypi
charset-normalizer        3.1.0                    pypi_0    pypi
click                     8.1.3                    pypi_0    pypi
cloudpickle               2.2.1                    pypi_0    pypi
colorama                  0.4.6                    pypi_0    pypi
comm                      0.1.3                    pypi_0    pypi
contourpy                 1.1.0                    pypi_0    pypi
cycler                    0.11.0                   pypi_0    pypi
dask                      2023.6.1                 pypi_0    pypi
debugpy                   1.6.7                    pypi_0    pypi
decorator                 5.1.1                    pypi_0    pypi
defusedxml                0.7.1                    pypi_0    pypi
distinctipy               1.2.2                    pypi_0    pypi
entrypoints               0.4                      pypi_0    pypi
exceptiongroup            1.1.2                    pypi_0    pypi
executing                 1.2.0                    pypi_0    pypi
exifread                  3.0.0                    pypi_0    pypi
fasteners                 0.18                     pypi_0    pypi
fastjsonschema            2.17.1                   pypi_0    pypi
fonttools                 4.40.0                   pypi_0    pypi
fqdn                      1.5.1                    pypi_0    pypi
frozenlist                1.3.3                    pypi_0    pypi
fsspec                    2023.6.0                 pypi_0    pypi
git                       2.40.1               haa95532_1
idna                      3.4                      pypi_0    pypi
importlib-metadata        6.7.0                    pypi_0    pypi
importlib-resources       5.12.0                   pypi_0    pypi
intake                    0.7.0                    pypi_0    pypi
intake-xarray             0.7.0                    pypi_0    pypi
ipykernel                 6.23.3                   pypi_0    pypi
ipython                   8.14.0                   pypi_0    pypi
ipython-genutils          0.2.0                    pypi_0    pypi
ipywidgets                8.0.6                    pypi_0    pypi
isoduration               20.11.0                  pypi_0    pypi
jedi                      0.18.2                   pypi_0    pypi
jinja2                    3.1.2                    pypi_0    pypi
jsonpointer               2.4                      pypi_0    pypi
jsonschema                4.17.3                   pypi_0    pypi
jupyter                   1.0.0                    pypi_0    pypi
jupyter-client            8.3.0                    pypi_0    pypi
jupyter-console           6.6.3                    pypi_0    pypi
jupyter-core              5.3.1                    pypi_0    pypi
jupyter-events            0.6.3                    pypi_0    pypi
jupyter-server            2.7.0                    pypi_0    pypi
jupyter-server-terminals  0.4.4                    pypi_0    pypi
jupyterlab-pygments       0.2.2                    pypi_0    pypi
jupyterlab-widgets        3.0.7                    pypi_0    pypi
kiwisolver                1.4.4                    pypi_0    pypi
locket                    1.0.0                    pypi_0    pypi
m2-base                   1.0.0                         3
m2-bash                   4.3.042                       5
m2-bash-completion        2.3                           2
m2-catgets                1.1                           3
m2-coreutils              8.25                        102
m2-dash                   0.5.8                         2
m2-file                   5.25                          2
m2-filesystem             2016.04                       4
m2-findutils              4.6.0                         2
m2-gawk                   4.1.3                         2
m2-gcc-libs               5.3.0                         4
m2-gettext                0.19.7                        4
m2-gmp                    6.1.0                         3
m2-grep                   2.22                          4
m2-gzip                   1.7                           2
m2-inetutils              1.9.2                         2
m2-info                   6.0                           2
m2-less                   481                           2
m2-libasprintf            0.19.7                        4
m2-libcatgets             1.1                           3
m2-libcrypt               1.3                           2
m2-libgettextpo           0.19.7                        4
m2-libiconv               1.14                          3
m2-libintl                0.19.7                        4
m2-liblzma                5.2.2                         2
m2-libpcre                8.38                          2
m2-libreadline            6.3.008                       8
m2-libutil-linux          2.26.2                        2
m2-libxml2                2.9.2                         3
m2-mintty                 1!2.2.3                       2
m2-mpfr                   3.1.4                         2
m2-msys2-launcher-git     0.3.28.860c495                2
m2-msys2-runtime          2.5.0.17080.65c939c               3
m2-ncurses                6.0.20160220                  2
m2-sed                    4.2.2                         3
m2-tftp-hpa               5.2                           2
m2-time                   1.7                           2
m2-ttyrec                 1.0.8                         2
m2-tzcode                 2015.e                        2
m2-util-linux             2.26.2                        2
m2-which                  2.21                          3
m2-zlib                   1.2.8                         4
markupsafe                2.1.3                    pypi_0    pypi
matplotlib                3.7.1                    pypi_0    pypi
matplotlib-inline         0.1.6                    pypi_0    pypi
mistune                   3.0.1                    pypi_0    pypi
msgpack                   1.0.5                    pypi_0    pypi
msys2-conda-epoch         20160418                      1
multidict                 6.0.4                    pypi_0    pypi
nbclassic                 1.0.0                    pypi_0    pypi
nbclient                  0.8.0                    pypi_0    pypi
nbconvert                 7.6.0                    pypi_0    pypi
nbformat                  5.9.0                    pypi_0    pypi
nest-asyncio              1.5.6                    pypi_0    pypi
netcdf4                   1.6.4                    pypi_0    pypi
notebook                  6.5.4                    pypi_0    pypi
notebook-shim             0.2.3                    pypi_0    pypi
numcodecs                 0.11.0                   pypi_0    pypi
numpy                     1.25.0                   pypi_0    pypi
openssl                   1.1.1u               h2bbff1b_0
overrides                 7.3.1                    pypi_0    pypi
packaging                 23.1                     pypi_0    pypi
pandas                    1.5.3                    pypi_0    pypi
pandocfilters             1.5.0                    pypi_0    pypi
parso                     0.8.3                    pypi_0    pypi
partd                     1.4.0                    pypi_0    pypi
pickleshare               0.7.5                    pypi_0    pypi
pillow                    10.0.0                   pypi_0    pypi
pip                       23.1.2           py39haa95532_0
platformdirs              3.8.0                    pypi_0    pypi
prometheus-client         0.17.0                   pypi_0    pypi
prompt-toolkit            3.0.38                   pypi_0    pypi
psutil                    5.9.5                    pypi_0    pypi
pure-eval                 0.2.2                    pypi_0    pypi
pycparser                 2.21                     pypi_0    pypi
pydantic                  1.10.10                  pypi_0    pypi
pygments                  2.15.1                   pypi_0    pypi
pyparsing                 3.1.0                    pypi_0    pypi
pyrsistent                0.19.3                   pypi_0    pypi
python                    3.9.5                h6244533_3
python-dateutil           2.8.2                    pypi_0    pypi
python-json-logger        2.0.7                    pypi_0    pypi
pytz                      2023.3                   pypi_0    pypi
pywin32                   306                      pypi_0    pypi
pywinpty                  2.0.10                   pypi_0    pypi
pyyaml                    6.0                      pypi_0    pypi
pyzmq                     25.1.0                   pypi_0    pypi
qtconsole                 5.4.3                    pypi_0    pypi
qtpy                      2.3.1                    pypi_0    pypi
requests                  2.31.0                   pypi_0    pypi
rfc3339-validator         0.1.4                    pypi_0    pypi
rfc3986-validator         0.1.1                    pypi_0    pypi
scipy                     1.11.1                   pypi_0    pypi
scivision                 0.5.0                    pypi_0    pypi
send2trash                1.8.2                    pypi_0    pypi
setuptools                67.8.0           py39haa95532_0
six                       1.16.0                   pypi_0    pypi
sniffio                   1.3.0                    pypi_0    pypi
soupsieve                 2.4.1                    pypi_0    pypi
sqlite                    3.41.2               h2bbff1b_0
stack-data                0.6.2                    pypi_0    pypi
terminado                 0.17.1                   pypi_0    pypi
tinycss2                  1.2.1                    pypi_0    pypi
toolz                     0.12.0                   pypi_0    pypi
tornado                   6.3.2                    pypi_0    pypi
traitlets                 5.9.0                    pypi_0    pypi
typing-extensions         4.7.1                    pypi_0    pypi
tzdata                    2023c                h04d1e81_0
uri-template              1.3.0                    pypi_0    pypi
urllib3                   2.0.3                    pypi_0    pypi
vc                        14.2                 h21ff451_1
vs2015_runtime            14.27.29016          h5e58377_2
wcwidth                   0.2.6                    pypi_0    pypi
webcolors                 1.13                     pypi_0    pypi
webencodings              0.5.1                    pypi_0    pypi
websocket-client          1.6.1                    pypi_0    pypi
wheel                     0.38.4           py39haa95532_0
widgetsnbextension        4.0.7                    pypi_0    pypi
xarray                    2023.6.0                 pypi_0    pypi
yarl                      1.9.2                    pypi_0    pypi
zarr                      2.15.0                   pypi_0    pypi
zipp                      3.15.0                   pypi_0    pypi

@evangeline-corcoran When did it stop working for you?

about a month ago

ots22 commented

I haven't tried to reproduce (don't have easy access to a Windows machine), but some ideas:

Will try to push the fix above and can see if that helps. We can include Windows in GitHub Actions which might have picked this up.

ots22 commented

This issue is mentioned in the Python docs as it happens: https://docs.python.org/3/library/io.html#text-encoding

ots22 commented

The above PR should fix it, and adds Windows to the CI

Thanks, looks good to merge